problem:
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: Re...
分类:
其他好文 时间:
2015-05-05 10:36:19
阅读次数:
126
Hardwood Species
Time Limit: 10000MS
Memory Limit: 65536K
Total Submissions: 20085
Accepted: 7911
Description
Hardwoods are the botanical group of trees that have bro...
分类:
其他好文 时间:
2015-05-05 08:59:24
阅读次数:
144
题目描述:
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
...
分类:
其他好文 时间:
2015-05-05 08:58:49
阅读次数:
146
Binary Search:二分查找实现方式:recursive or iterative注意问题,终止循环条件,移动start,end时边界值,start = mid,end = midTemplate:1. 在排序的数组中找A[i] == i的index,有重复元素存在. (cc150 Ques...
分类:
其他好文 时间:
2015-05-05 08:50:23
阅读次数:
163
A little girl loves problems on trees very much. Here's one of them.
A tree is an undirected connected graph, not containing cycles. The degree of node x in the tree is the number of nodes y of
t...
分类:
其他好文 时间:
2015-05-05 01:22:29
阅读次数:
183
https://leetcode.com/problems/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...
分类:
其他好文 时间:
2015-05-05 01:15:10
阅读次数:
184
题目Given two binary trees, write a function to check if they are equal or not.
分析写一个检查两个二叉树是否相等的函数...
分类:
其他好文 时间:
2015-05-04 22:16:06
阅读次数:
114
Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For examp...
分类:
其他好文 时间:
2015-05-04 20:14:35
阅读次数:
182
Add Binary
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
解题思路:
题意为两个字符串表示的二进制相加,求结果。记住常字符串与字符串变量能够相加,但是字符串不能与数字相加,字符...
分类:
其他好文 时间:
2015-05-04 20:12:43
阅读次数:
149
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110...
分类:
其他好文 时间:
2015-05-04 18:18:59
阅读次数:
71