摘要: Convert Sorted List to Binary Search TreeGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.... 阅读全文
posted @ 2015-09-07 16:56 Sean_le 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Convert Sorted Array to Binary Search TreeGiven an array where elements are sorted in ascending order, convert it to a height balanced BST.BST的规则就是左& ... 阅读全文
posted @ 2015-09-07 16:22 Sean_le 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given... 阅读全文
posted @ 2015-09-07 11:20 Sean_le 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Product of Array Except SelfGiven an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the eleme... 阅读全文
posted @ 2015-09-07 10:23 Sean_le 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−... 阅读全文
posted @ 2015-09-06 23:55 Sean_le 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Climbing StairsYou are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct way... 阅读全文
posted @ 2015-09-06 23:25 Sean_le 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Single Number IIIGiven an array of numbersnums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find t... 阅读全文
posted @ 2015-09-06 22:27 Sean_le 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Single Number IIGiven an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a lin... 阅读全文
posted @ 2015-09-06 20:01 Sean_le 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Search Insert PositionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if ... 阅读全文
posted @ 2015-09-06 18:22 Sean_le 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a to... 阅读全文
posted @ 2015-09-06 17:03 Sean_le 阅读(132) 评论(0) 推荐(0) 编辑