码迷,mamicode.com
首页 >  
搜索关键字:minimum    ( 3256个结果
算法导论第9章中位数和顺序统计学
#include #include #ifdef __linux #include #endif // MINIMUM(A) // MIN = A[1] // for i = 2 to A.length // if min > A[i] // min = A[i] // return min int...
分类:编程语言   时间:2015-02-09 21:26:03    阅读次数:373
leetcode[76]Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA...
分类:Windows程序   时间:2015-02-09 15:38:06    阅读次数:176
leetcode[64]Minimum Path Sum
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo...
分类:其他好文   时间:2015-02-09 15:33:25    阅读次数:165
leetcode[72]Edit Distance
Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the fol...
分类:其他好文   时间:2015-02-09 15:23:38    阅读次数:103
[LeetCode]Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() –...
分类:其他好文   时间:2015-02-09 14:13:19    阅读次数:157
Leetcode_Minimum Depth of Binary Tree
题意为得出二叉树的最小深度,但深度是定义为从根节点到叶子节点的最少节点数。 容易出错的地方:为空节点时,直接返回0。这是不对的,要判断其是否有兄弟节点,没有兄弟节点的时候才能返回0,即这个节点的父节点是一个叶子节点。 错解1: class Solution { public: int minDepth(TreeNode *root) { if(root==nullptr) ...
分类:其他好文   时间:2015-02-09 12:58:55    阅读次数:132
leetcode[153]Find Minimum in Rotated Sorted Array
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-02-09 00:44:49    阅读次数:135
leetcode[155]Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes...
分类:其他好文   时间:2015-02-09 00:43:38    阅读次数:237
leetcode[154]Find Minimum in Rotated Sorted Array II
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-02-09 00:37:00    阅读次数:166
Easy Task
You are given n integers. Your task is very easy. You should find the maximum integer a and the minimum integer b among these n integers. And then you should replace both a and bwith a-b. Your task ...
分类:其他好文   时间:2015-02-08 15:34:12    阅读次数:165
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!