码迷,mamicode.com
首页 >  
搜索关键字:maximum    ( 4142个结果
LeetCode--Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. /** * Definition for binary tree *...
分类:其他好文   时间:2015-01-14 12:49:54    阅读次数:131
[leetcode]Maximum Gap
问题描述: Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 ele...
分类:其他好文   时间:2015-01-13 23:17:46    阅读次数:330
LeetCode-Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [?2,1,?3,4,?1,2,1,?5,4], the contiguous subarray [4,?1,2,1] ha...
分类:其他好文   时间:2015-01-13 21:46:20    阅读次数:181
uva10827-Maximum sum on a torus(矩阵最大和的变形)
题目;uva10827-Maximum sum on a torus(矩阵最大和的变形)题目大意:就是uva108的变形,矩阵能够连通,就是能够从后面连到前面。这里把矩阵复制三遍,然后又一次生成一个大的矩阵,就能够解决联通的问题。再枚举矩阵的起点和终点全部情况,保留最大值就能够了。比如:1 2 3 ...
分类:其他好文   时间:2015-01-13 21:21:05    阅读次数:113
leetcode——Binary Tree Maximum Path Sum
这题很难,主要是我没理解题目的意思,后来看着给的测试参考,和网上找的答案,终于理解了。 例如: 给的 正确的路线应该是 也就是说,路径是一条的,不是有分叉的,之所以算出55是因为把>0的数都加上去了,这样路径就分叉了,就不是一条路径了,所以用dfs做时,返回值应该是左子树或者右子树中>0且比较大的那...
分类:其他好文   时间:2015-01-13 21:17:50    阅读次数:127
leetcode 149. Max Points on a Line
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.两层循环,将在同一直线上的点放入hash table,找到hash table中的最大值。 1 int m...
分类:其他好文   时间:2015-01-13 19:36:55    阅读次数:95
meta viewport使用说明
width - viewport的宽度 height - viewport的高度initial-scale - 初始的缩放比例minimum-scale - 允许用户缩放到的最小比例maximum-scale - 允许用户缩放到的最大比例user-scalable - 用户是否可以手动缩放width...
分类:Web程序   时间:2015-01-13 17:21:46    阅读次数:157
【POJ3693】Maximum repetition substring 后缀数组恶心题
题意: 给一个字符串,然后找一个子串,使子串满足其中连续重复子串最多。 比如ababab,重复次数为3,ababa,重复次数为1(abab是两次) 恶心在于还要输出最小字典序。 题解网上都有,不发了。 代码: #include #include #include #include #define N 101000 #define LOGN 20 #define...
分类:编程语言   时间:2015-01-13 15:58:20    阅读次数:256
Maximum Depth of Binary Tree
https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/Given a binary tree, find its maximum depth.The maximum depth is the number of nodes alo...
分类:其他好文   时间:2015-01-13 14:13:55    阅读次数:105
Java-Maximum Gap
Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements. Y...
分类:编程语言   时间:2015-01-12 22:34:27    阅读次数:274
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!