- 博客(5)
- 收藏
- 关注
原创 Search in Rotated Sorted Array-旋转数组的查找
问题描述:1.Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the
2016-05-20 16:01:23
390
原创 Construct Binary Tree from Preorder and Inorder Traversal-先序和中序构造树
问题描述:Given preorder and inorder traversal of a tree, construct the binary tree.还有个是中序和后序。其实两个题本质是一样的。问题分析:暂时只想到递归的方法来解题,可是看到耗时似乎蛮高的,不知道还有什么更搞笑的解法。 这个思路没什么好讲的,通过先序或者后序找出根节点,然后将中序的序列分开,这样
2016-05-20 15:01:06
471
原创 triangle- 求从顶向下的三角形的最小路径和问题
问题描述:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3
2016-05-20 12:46:48
1353
原创 Find Peak Element-找出峰值元素w问题描述
问题描述:A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple p
2016-05-19 20:58:06
591
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人