码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
[LeetCode#100]Same Tree
The problem:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ...
分类:其他好文   时间:2015-01-11 06:09:38    阅读次数:186
[LeetCode#104, 111]Maximum Depth of Binary Tree, Minimum Depth of Binary Tree
The problem 1:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to t...
分类:其他好文   时间:2015-01-11 06:07:49    阅读次数:216
[LeetCode#]
The problem:Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree,...
分类:其他好文   时间:2015-01-11 00:59:13    阅读次数:287
LeetCode-114 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-11 00:53:08    阅读次数:262
bfs-dfs-bst
/**  * Definition for binary tree  * struct TreeNode {  *     int val;  *     TreeNode *left;  *     TreeNode *right;  *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}  * }; ...
分类:其他好文   时间:2015-01-10 18:20:29    阅读次数:181
Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II...
分类:其他好文   时间:2015-01-10 18:19:33    阅读次数:128
Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: Given binary ...
分类:其他好文   时间:2015-01-10 18:17:08    阅读次数:177
Binary Search Tree Iterator 173
题目描述:对于一个二叉查找树,设计一个迭代器,每次调用会返回下一个最小值题目分析:没什么好说的二叉树的先序遍历代码: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * Tre...
分类:其他好文   时间:2015-01-10 17:55:11    阅读次数:203
Maximum Depth of Binary Tree
求树的深度...
分类:其他好文   时间:2015-01-10 16:41:38    阅读次数:94
[leetcode] Binary Tree Zigzag Level Order Traversal
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
分类:其他好文   时间:2015-01-10 16:35:50    阅读次数:155
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!