码迷,mamicode.com
首页 >  
搜索关键字:maximum repetition s    ( 4177个结果
LeetCode--Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on...
分类:其他好文   时间:2015-01-15 09:27:56    阅读次数:187
LeetCode No.5 Longest Palindromic Substring
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2015-01-14 16:44:41    阅读次数:109
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
【算法导论】红黑树详解之一(插入)
红黑树是建立在二叉查找树的基础之上的,关于二叉查找树可以参看【算法导论】二叉搜索树的插入和删除和【算法导论】二叉树的前中后序非递归遍历实现。对于高度为h的二叉查找树而言,它的SEARCH、INSERT、DELETE、MINIMUM、MAXIMUM等操作的时间复杂度均为O(h)。所以在二叉查找树的高度较高时,上述操作会比较费时,而红黑树就可以解决这种问题。...
分类:编程语言   时间:2015-01-14 12:49:51    阅读次数:1480
[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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!