码迷,mamicode.com
首页 >  
搜索关键字:maximum    ( 4142个结果
LeetCode Maximum Depth of Binary Tree (求树的深度)
题意:给一棵二叉树,求其深度。思路:递归比较简洁,先求左子树深度,再求右子树深度,比较其结果,返回:max_one+1。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 ...
分类:其他好文   时间:2015-07-11 13:25:41    阅读次数:125
5:Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:其他好文   时间:2015-07-11 09:00:02    阅读次数:101
leetcode104 Maximum Depth
题意:二叉树最大深度思路:递归,但是不知道怎么回事直接在return里面计算总是报超时,用俩变量就可以A···奇怪,没想通代码:int maxDepth(TreeNode* root) { if(!root) return 0; int l = ma...
分类:其他好文   时间:2015-07-11 01:00:42    阅读次数:110
web页面自适应手机屏幕宽度
在网页的中增加以上这句话,可以让网页的宽度自动适应手机屏幕的宽度。其中:width=device-width:表示宽度是设备屏幕的宽度initial-scale=1.0:表示初始的缩放比例minimum-scale=0.5:表示最小的缩放比例maximum-scale=2.0:表示最大的缩放比例us...
分类:移动开发   时间:2015-07-10 18:30:56    阅读次数:112
Leetcode & CTCI ---Day 1
Maximum Depth of Binary Tree (DFS, TREE)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path fr...
分类:其他好文   时间:2015-07-10 13:17:22    阅读次数:99
leetcode_152题——Maximum Product Subarray(动态规划)
Maximum Product SubarrayTotal Accepted:33022Total Submissions:170218My SubmissionsQuestionSolutionFind the contiguous subarray within an array (contai...
分类:其他好文   时间:2015-07-09 22:38:22    阅读次数:120
php学习笔记之一
用户有一个excel要导出,总行数有4000多行,导出时候报错了,超时了,本来更改pb.ini中最大执行时间就行了,但是用户是虚拟机,改起来麻烦,网上查找发现,解决方法报错二:30秒运行超时的错误(Maximum execution time of 30 seconds exceeded)解决办法:...
分类:Web程序   时间:2015-07-09 17:57:15    阅读次数:146
移动端的特殊头部布局
fasdasda 这样布局会自动缩放, content="width=320只需按照320来宽网站来写就可以了,maximum-scale=2让网页可以缩放到320的2倍640了。
分类:移动开发   时间:2015-07-09 12:40:45    阅读次数:116
152 Maximum Product Subarray
这道题使用dp。 dpMax[i] = max(nums[i], nums[i]*dpMax[i-1], nums[i]*dpMin[i-1])多记录一个 dpMin[i]= min(nums[i], nums[i]*dpMax[i-1], nums[i]*dpMin[i-1])但是空间上不需...
分类:其他好文   时间:2015-07-08 00:27:56    阅读次数:88
leetcode_53题——Maximum Subarray(动态规划)
Maximum SubarrayTotal Accepted:62857Total Submissions:182415My SubmissionsQuestionSolutionFind the contiguous subarray within an array (containing at ...
分类:其他好文   时间:2015-07-07 18:37:57    阅读次数:139
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!