码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
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 ...
分类:其他好文   时间:2015-01-02 21:07:27    阅读次数:155
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 ...
分类:其他好文   时间:2015-01-02 21:01:15    阅读次数:184
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 stil...
分类:其他好文   时间:2015-01-02 18:45:09    阅读次数:149
Leetcode:Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:其他好文   时间:2015-01-02 17:27:08    阅读次数:116
[LeetCode]108 Convert Sorted Array to Binary Search Tree
https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/http://fisherlei.blogspot.com/2013/03/leetcode-convert-sorted-array-to-binary.html/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNod..
分类:其他好文   时间:2015-01-02 16:19:16    阅读次数:151
[LeetCode]109 Convert Sorted List to Binary Search Tree
https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/http://fisherlei.blogspot.com/2013/01/leetcode-convert-sorted-list-to-binary.htmlhttp://blog.csdn.net/worldwindjp/article/details/39722643/** *Definitionforsingly-linkedlist. *public..
分类:其他好文   时间:2015-01-02 16:17:43    阅读次数:215
Leetcode:Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:其他好文   时间:2015-01-02 15:50:53    阅读次数:107
Leetcode:Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:其他好文   时间:2015-01-02 15:50:42    阅读次数:124
leetcode 173: Binary Search Tree Iterator
Binary Search Tree Iterator Total Accepted: 1141 Total Submissions: 3857 Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. ...
分类:其他好文   时间:2015-01-02 13:28:25    阅读次数:165
[LeetCode]113.Path Sum II
【题目】 Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example: Given the below binary tree and sum = 22, 5 ...
分类:其他好文   时间:2015-01-02 12:20:43    阅读次数:104
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!