Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes wit...
分类:
其他好文 时间:
2015-03-06 23:33:39
阅读次数:
201
Convert Sorted Array to Binary Search Tree问题:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路: 递归,....
分类:
其他好文 时间:
2015-03-06 18:29:42
阅读次数:
131
1.题目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: Recursive solution is trivial, cou...
分类:
其他好文 时间:
2015-03-06 17:04:22
阅读次数:
134
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:
其他好文 时间:
2015-03-06 16:15:45
阅读次数:
149
1.题目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.2.解决方案1class S...
分类:
其他好文 时间:
2015-03-06 16:01:10
阅读次数:
109
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number...
分类:
其他好文 时间:
2015-03-06 15:34:13
阅读次数:
153
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 the farthest leaf node.2.解决方案1class Solution {
public:...
分类:
其他好文 时间:
2015-03-06 11:22:23
阅读次数:
126
问题描述:对数组元素进行查找与排序,利用二分法与递归实现。完整实例1:publicclassSortDemo
{
publicstaticvoidmain(String[]args)
{
int[]arr={10,2,300,41,15,6};
for(inta:arr)
{
System.out.print("["+a+"]");
}
//newSortDemo().insertSort(arr);
newSortDemo().binary..
分类:
编程语言 时间:
2015-03-06 06:25:16
阅读次数:
188
Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou...
分类:
其他好文 时间:
2015-03-06 00:57:57
阅读次数:
152
转自:http://unix.stackexchange.com/questions/5719/linux-gnu-gcc-ld-version-scripts-and-the-elf-binary-format-how-does-it-wor/10317#10317First of all, EL...
分类:
其他好文 时间:
2015-03-05 22:10:06
阅读次数:
223