码迷,mamicode.com
首页 >  
搜索关键字:note    ( 7358个结果
[C++]LeetCode: 95 Binary Tree Preorder Traversal (先序遍历)
题目: Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,2,3]. Note: Recursive...
分类:编程语言   时间:2015-01-14 22:59:13    阅读次数:174
LeetCode--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? class Solution...
分类:其他好文   时间:2015-01-14 22:57:33    阅读次数:162
[leetcode]179 Largest Number
问题描述: Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result may...
分类:其他好文   时间:2015-01-14 21:28:06    阅读次数:196
[LeetCode]173 Binary Search Tree Iterator
https://oj.leetcode.com/problems/binary-search-tree-iterator//** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassBSTIterator{ // //NOTE //Aftertheiteratorbuilt,ifwemodifytheor..
分类:其他好文   时间:2015-01-14 18:17:56    阅读次数:165
[C++]LeetCode: 93 Binary Search Tree Iterator (经典题,非递归的中序遍历)
题目: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the next smallest number in the BST. Note:...
分类:编程语言   时间:2015-01-14 18:01:28    阅读次数:182
LeetCode--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 constant ...
分类:其他好文   时间:2015-01-14 17:55:09    阅读次数:199
LeetCode88——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 ...
分类:其他好文   时间:2015-01-14 16:54:36    阅读次数:183
good-article.3--------Longest Palindromic Substring Part II
Given a string S, find the longest palindromic substring in S. Note: This is Part II of the article: Longest Palindromic Substring. Here, we describe an algorithm (Manacher’s algorithm) which...
分类:其他好文   时间:2015-01-14 15:40:50    阅读次数:326
sed系列:多命令执行
Syntax:  #sed -e 'command' -e 'command' filename  Note: -e option is optional for sed with single command. sed will execute the each set of command while processing input from the pattern buffer.  ...
分类:其他好文   时间:2015-01-14 15:35:56    阅读次数:164
LeetCode--Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Could you devis...
分类:其他好文   时间:2015-01-14 09:53:16    阅读次数:154
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!