码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
[leedcode 116] Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:其他好文   时间:2015-07-22 22:23:45    阅读次数:166
[leedcode 117] 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-07-22 22:11:30    阅读次数:101
Sum Root to Leaf Numbers
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x...
分类:其他好文   时间:2015-07-22 20:37:42    阅读次数:92
leetcode_226题——Invert Binary Tree(队列,广度优先搜索)
Invert Binary TreeTotal Accepted:22352Total Submissions:62065My SubmissionsQuestionSolutionInvert a binary tree. 4 / \ 2 7 / \ / \1 3...
分类:其他好文   时间:2015-07-22 20:35:16    阅读次数:103
[leedcode 112] 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-07-22 20:20:26    阅读次数:129
(LeetCode)二叉树中和为某一值的路径
原体如下: 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. For example: Given the below binary tr...
分类:其他好文   时间:2015-07-22 18:45:58    阅读次数:87
[geeksforgeeks] Convert a given Binary Tree to Doubly Linked List
http://www.geeksforgeeks.org/in-place-convert-a-given-binary-tree-to-doubly-linked-list/Given a Binary Tree (Bt), convert it to a Doubly Linked List(D...
分类:其他好文   时间:2015-07-22 18:32:21    阅读次数:103
[geeksforgeeks] Lowest Common Ancestor in a Binary Search Tree.
http://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-search-tree/Lowest Common Ancestor in a Binary Search Tree.Given values of two nodes i...
分类:其他好文   时间:2015-07-22 18:18:44    阅读次数:103
leetCode(46):Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note:  You may assume k is always valid, 1 ≤ k ≤ BST's total elements.         直观地一想,查找第k小的数,不就是...
分类:其他好文   时间:2015-07-22 16:22:04    阅读次数:87
#leetcode#Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / 2 2 / \ / 3 4 4 3 But the f...
分类:其他好文   时间:2015-07-22 16:10:25    阅读次数:102
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!