摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题目大意:给定一个升序序列的数组,将其转换为二叉搜索树。解题思路:数组中间元素是根元素,根元素将数组划分为... 阅读全文
posted @ 2015-04-20 21:28 丶Blank 阅读(143) 评论(0) 推荐(0)
摘要: Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest formed num... 阅读全文
posted @ 2015-04-20 19:36 丶Blank 阅读(189) 评论(0) 推荐(0)
摘要: Given a range [m, n] where 0 offset = new HashSet(); for (int i = 0; i >=1; n>>=1; offset++; } return m<<o... 阅读全文
posted @ 2015-04-20 17:42 丶Blank 阅读(1367) 评论(0) 推荐(0)
摘要: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in... 阅读全文
posted @ 2015-04-20 16:43 丶Blank 阅读(122) 评论(0) 推荐(0)
摘要: Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2015-04-20 16:36 丶Blank 阅读(176) 评论(0) 推荐(0)