欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
64 Minimum Path Sum
Given 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 along its path....
分类:
其他好文 时间:
2015-04-26 09:19:46
阅读次数:
106
原来求逆序数还可以用线段树,涨姿势了。首先求出原始序列的逆序数,然后递推每一个序列的逆序数。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 20000 + 10; 7 8 int n...
分类:
其他好文 时间:
2015-04-25 21:09:48
阅读次数:
202
求从根节点到叶子节点的最短路径。【思路】开始想到返回左右子树最短深度,测试发现对于一个根节点带一个孩子节点,其最短路径是2,不是最小深度1,此种特殊情况单独列出。【my code】int minDepth(TreeNode *root) { if(root==NULL) ...
分类:
其他好文 时间:
2015-04-24 08:56:48
阅读次数:
114
题目描述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.这里需要理解一个概念什么为Rotated Sorted Array。根据题目描述,Rotated...
分类:
其他好文 时间:
2015-04-22 18:23:25
阅读次数:
125
题目来自于:LeetCode
https://leetcode.com/problems/minimum-path-sum/
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of...
分类:
其他好文 时间:
2015-04-22 18:20:03
阅读次数:
115
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-04-22 13:30:51
阅读次数:
96
压力太大了,这道题先不做了public class Solution { public String minWindow(String S, String T) { // 讲解http://articles.leetcode.com/2010/11/finding-minimum...
在网页的中增加以上这句话,可以让网页的宽度自动适应手机屏幕的宽度:1 1、width=device-width :表示宽度是设备屏幕的宽度2、initial-scale=1.0:表示初始的缩放比例3、minimum-scale=0.5:表示最小的缩放比例4、maximum-scale=2.0:表示....
分类:
移动开发 时间:
2015-04-20 20:34:54
阅读次数:
136
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 22346
Accepted: 7924
Description
Given a connected undirected graph, tell if its minimum spanning tree is unique.
Def...
分类:
其他好文 时间:
2015-04-19 22:49:43
阅读次数:
237
RMQ (Range Minimum/Maximum Query):对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j<=n),返回数列A中下标在i,j里的最小(大)值,也就是说,RMQ问题是指求区间最值的问题。
分类:
编程语言 时间:
2015-04-19 17:50:40
阅读次数:
181