上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页

2014年12月22日

摘要: Binary Tree Level Order TraversalGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).... 阅读全文
posted @ 2014-12-22 20:24 Yu's Garden 阅读(529) 评论(0) 推荐(0) 编辑
摘要: Minimum Path SumGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers ... 阅读全文
posted @ 2014-12-22 20:06 Yu's Garden 阅读(718) 评论(0) 推荐(0) 编辑

2014年12月21日

摘要: Sort Colors II 原题链接: http://lintcode.com/zh-cn/problem/sort-colors-ii/#Given an array ofnobjects with k different colors (numbered from 1 to k), sort ... 阅读全文
posted @ 2014-12-21 23:53 Yu's Garden 阅读(6935) 评论(11) 推荐(0) 编辑
摘要: Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre... 阅读全文
posted @ 2014-12-21 21:08 Yu's Garden 阅读(7785) 评论(0) 推荐(1) 编辑
摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.Show TagsSOLUTION 1:解法很直观。先找到最小长度,然后逐个字母遍历,... 阅读全文
posted @ 2014-12-21 19:15 Yu's Garden 阅读(588) 评论(0) 推荐(0) 编辑

2014年12月20日

摘要: Maximum SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [... 阅读全文
posted @ 2014-12-20 20:25 Yu's Garden 阅读(3399) 评论(1) 推荐(0) 编辑
摘要: Majority Number II 原题链接: http://lintcode.com/en/problem/majority-number-ii/#Given an array of integers, the majority number is the number that occurs ... 阅读全文
posted @ 2014-12-20 19:42 Yu's Garden 阅读(3170) 评论(1) 推荐(0) 编辑
摘要: Interleaving Positive and Negative Numbers 原题链接 : http://lintcode.com/zh-cn/problem/interleaving-positive-and-negative-numbers/Given an array with pos... 阅读全文
posted @ 2014-12-20 17:00 Yu's Garden 阅读(3527) 评论(0) 推荐(1) 编辑
摘要: Implement Queue by Stacks 原题链接 : http://lintcode.com/zh-cn/problem/implement-queue-by-stacks/#As the title described, you should only use two stacks t... 阅读全文
posted @ 2014-12-20 15:39 Yu's Garden 阅读(1230) 评论(0) 推荐(0) 编辑
摘要: Quick Sorthttp://en.wikipedia.org/wiki/QuicksortQuicksort, orpartition-exchange sort, is asorting algorithmdeveloped byTony Hoarethat,on average, make... 阅读全文
posted @ 2014-12-20 12:43 Yu's Garden 阅读(1477) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 17 下一页

导航