码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
[LeetCode]111 Minimum Depth of Binary Tree
https://oj.leetcode.com/problems/minimum-depth-of-binary-tree/http://blog.csdn.net/linhuanmars/article/details/19660209/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassSoluti..
分类:其他好文   时间:2015-01-06 15:47:12    阅读次数:118
Leetcode: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.Callingnext()will return the next...
分类:其他好文   时间:2015-01-06 13:44:43    阅读次数:276
[LeetCode]102 Binary Tree Level Order Traversal
https://oj.leetcode.com/problems/binary-tree-level-order-traversal/http://blog.csdn.net/linhuanmars/article/details/23404111/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassS..
分类:其他好文   时间:2015-01-06 12:09:39    阅读次数:175
[LeetCode]104 Maximum Depth of Binary Tree
https://oj.leetcode.com/problems/maximum-depth-of-binary-tree/http://blog.csdn.net/linhuanmars/article/details/19659525/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassSoluti..
分类:其他好文   时间:2015-01-06 12:08:50    阅读次数:184
[LeetCode]103 Binary Tree Zigzag Level Order Traversal
https://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/http://blog.csdn.net/linhuanmars/article/details/24509105/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publi..
分类:其他好文   时间:2015-01-06 12:07:28    阅读次数:147
LeetCode:Construct Binary Tree from Preorder and Inorder Traversal
题目描述: Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 解题思路:先序遍历的第一个元素为根元素,在中序遍历序列中找到根元素的位置。中...
分类:其他好文   时间:2015-01-06 11:58:44    阅读次数:159
[leetcode] Construct Binary Tree from Preorder and Inorder Traversal
题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree./** * Defini...
分类:其他好文   时间:2015-01-06 07:09:29    阅读次数:207
[leetcode] Flatten Binary Tree to Linked List
题目(Tree DFS)Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The...
分类:其他好文   时间:2015-01-06 07:04:43    阅读次数:210
[leetcode] Recover Binary Search Tree
题目:(Tree ,DFS)Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using ...
分类:其他好文   时间:2015-01-06 02:03:43    阅读次数:172
[LeetCode#69] Sqrt(x)
The problem:Implementint sqrt(int x).Compute and return the square root ofx.My analysis:The problem could be solved amazingly by using binary search.W...
分类:其他好文   时间:2015-01-06 01:59:20    阅读次数:219
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!