Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m...
分类:
其他好文 时间:
2015-01-10 11:15:19
阅读次数:
187
Minimum Depth of Binary Tree...
分类:
其他好文 时间:
2015-01-09 21:02:38
阅读次数:
175
Follow upfor "Find Minimum in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Suppose a sort...
分类:
其他好文 时间:
2015-01-09 20:54:15
阅读次数:
196
1. 概念:Binary-search tree(BST)是一颗二叉树,每个树上的节点都有parent.left.key。但找到x的parent就结束了吗,还没有,就像TREE-MINIMUM函数一样,我们需要逐层查找,当找到符合条件的parent后,我们递归的继续检查parent节点有没有pare...
分类:
编程语言 时间:
2015-01-09 20:48:25
阅读次数:
219
https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array/http://blog.csdn.net/linhuanmars/article/details/40449295publicclassSolution{
publicintfindMin(int[]num){
//Assumenumisnotnull.
returnfind(num,0,num.length-1);
}
privateintfind(int[]n,in..
分类:
其他好文 时间:
2015-01-09 19:35:03
阅读次数:
179
https://oj.leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/http://blog.csdn.net/linhuanmars/article/details/40449299publicclassSolution{
publicintfindMin(int[]num){
//SolutionA:
//returnfindMin_Iteration(num);
//SolutionB:
returnfindMin_Recu..
分类:
其他好文 时间:
2015-01-09 19:34:31
阅读次数:
165
题目:
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,4...
分类:
编程语言 时间:
2015-01-09 14:23:26
阅读次数:
207
题目:
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).
Find the minimum element.
You may assume no duplicate exi...
分类:
编程语言 时间:
2015-01-09 12:42:03
阅读次数:
253
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path. ...
分类:
其他好文 时间:
2015-01-09 09:10:42
阅读次数:
176
双指针思想,尾指针不断往后扫,当扫到有一个窗口包含了所有T的字符,然后再收缩头指针,直到不能再收缩为止。最后记录所有可能的情况中窗口最小的...