码迷,mamicode.com
首页 >  
搜索关键字:note    ( 7358个结果
LeetCode119——Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? 题目大意 给定一个索引k,...
分类:其他好文   时间:2015-01-27 18:21:38    阅读次数:172
LeetCode Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The...
分类:其他好文   时间:2015-01-27 14:57:01    阅读次数:149
【leetcode】Anagrams
AnagramsGiven an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.Anagrams:即字母个数和字母都相同,但是字母顺序不相...
分类:其他好文   时间:2015-01-27 00:08:17    阅读次数:250
Best Time to Buy and Sell Stock III Leetcode Python
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 at most two transactions. Note: You may not eng...
分类:编程语言   时间:2015-01-26 13:45:27    阅读次数:200
[C++]LeetCode: 124 Populating Next Right Pointers in Each Node II(链接二叉树)
题目: Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use co...
分类:编程语言   时间:2015-01-26 13:41:55    阅读次数:253
LeetCode 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: Elements in a triplet (a,b,c...
分类:其他好文   时间:2015-01-26 13:41:30    阅读次数:95
Populating Next Right Pointers in Each Node II Leetcode Python
Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tree could be any binary tree? Would your previous solution still work? Note: You may only use con...
分类:编程语言   时间:2015-01-26 12:02:14    阅读次数:197
拓扑排序模板
#include #include #include #include #include using namespace std; const int maxn=30; int head[maxn],ip,indegree[maxn]; int n,m,seq[maxn]; struct note { int v,next; } edge[maxn*maxn]; void ...
分类:编程语言   时间:2015-01-25 21:05:21    阅读次数:274
Factorial Trailing Zeroes
Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.public class Solution { pu...
分类:其他好文   时间:2015-01-25 20:55:19    阅读次数:119
JavaScript_NoteBook
JavaScriptNoteBook【浏览器对空白文本节点的兼容问题】注意:IE浏览器中会忽略元素节点之间的空白节点,而且其他浏览器不会忽略【解决办法方法】(使用三元运算符):varresult=baby.nextSibling.nodeType==1?baby.nextSibling:baby.nextSibling.nextSibling;【注释】如果baby...
分类:编程语言   时间:2015-01-25 19:43:07    阅读次数:179
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!