码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
A1043. Is It a Binary Search Tree (25)
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
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
LeetCode Binary Tree Preorder Traversal
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
[LeetCode] Scramble String 爬行字符串
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
Leetcode Same Tree
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
【leetcode】Gray Code
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
LeetCode Maximum Depth of Binary Tree
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
Java排序查找算法——二分法与递归的应用实例
问题描述:对数组元素进行查找与排序,利用二分法与递归实现。完整实例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
A1020. Tree Traversals (25)
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
so so.*.*
转自: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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!