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
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
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
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
/**
* 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...
分类:
其他好文 时间:
2015-01-10 18:19:33
阅读次数:
128
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
题目描述:对于一个二叉查找树,设计一个迭代器,每次调用会返回下一个最小值题目分析:没什么好说的二叉树的先序遍历代码: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * Tre...
分类:
其他好文 时间:
2015-01-10 17:55:11
阅读次数:
203
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