问题描述
Given a binary tree, return the preorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,2,3].
Note: Recurs...
分类:
其他好文 时间:
2014-09-02 17:50:45
阅读次数:
136
Maven下载地址:http://maven.apache.org/download.cgi
本文编写时最新版本为3.2.3,在页面选择Maven 3.2.3 (Binary zip)下载即可。
Eclipse下载地址:download.eclipse.org
本文所使用的Eclipse版本是Eclipse Kepler SR2。
A:
解压缩Maven到某个文件夹、例如 D:\apa...
分类:
其他好文 时间:
2014-09-02 15:54:55
阅读次数:
179
问题描述
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 the farthest leaf node.
解决方案
/**
* Definition fo...
分类:
其他好文 时间:
2014-09-02 00:26:44
阅读次数:
217
Scramble StringGiven a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible...
分类:
其他好文 时间:
2014-09-02 00:17:33
阅读次数:
260
LeetCode: Scramble StringGiven a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is o...
分类:
其他好文 时间:
2014-09-01 22:42:34
阅读次数:
308
LeetCode: Gray CodeThe gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n represen...
分类:
其他好文 时间:
2014-09-01 22:31:13
阅读次数:
289
源码ex6-2.rb :types_of_people = 10x = "There are #{types_of_people} types of people." binary = "binary"do_not = "don't"y = "Those who know '#{binary}...
分类:
其他好文 时间:
2014-09-01 17:32:43
阅读次数:
171
问题描述
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 identical and the nodes have the same value.
解决...
分类:
其他好文 时间:
2014-09-01 15:40:33
阅读次数:
146