码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
[LeetCode#129]Sum Root to Leaf Numbers
The problem:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2...
分类:其他好文   时间:2015-01-10 12:33:00    阅读次数:236
[LeetCode#110, 112, 113]Balanced Binary Tree, Path Sum, Path Sum II
Problem 1 [Balanced Binary Tree]Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as ...
分类:其他好文   时间:2015-01-10 06:36:11    阅读次数:290
Pat(Advanced Level)Practice--1086(Tree Traversals Again)
Pat1086代码 题目描述: An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6...
分类:其他好文   时间:2015-01-09 23:45:43    阅读次数:201
Binary Order function In Unix Network Programming
ByteOrder: 1 #include 2 3 int main(int argc, char**argv) 4 { 5 union { 6 short s; 7 char c[sizeof(short)]; 8 } un; 9 ...
分类:Web程序   时间:2015-01-09 23:34:47    阅读次数:196
Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST....
分类:其他好文   时间:2015-01-09 22:29:55    阅读次数:181
Minimum Depth of Binary Tree
Minimum Depth of Binary Tree...
分类:其他好文   时间:2015-01-09 21:02:38    阅读次数:175
Balanced Binary Tree
Balanced Binary Tree...
分类:其他好文   时间:2015-01-09 21:01:27    阅读次数:180
算法导论学习-binary search tree
1. 概念:Binary-search tree(BST)是一颗二叉树,每个树上的节点都有parent.left.key。但找到x的parent就结束了吗,还没有,就像TREE-MINIMUM函数一样,我们需要逐层查找,当找到符合条件的parent后,我们递归的继续检查parent节点有没有pare...
分类:编程语言   时间:2015-01-09 20:48:25    阅读次数:219
[LeetCode]162 Find Peak Element
https://oj.leetcode.com/problemset/algorithms/http://siddontang.gitbooks.io/leetcode-solution/content/array/find_peak_element.htmlpublicclassSolution{ publicintfindPeakElement(int[]num){ //SolutionA: returnfindPeakElement_Binary(num); //SolutionB: //retur..
分类:其他好文   时间:2015-01-09 19:31:41    阅读次数:202
[LeetCode]156 Binary Tree Upside Down
https://oj.leetcode.com/problems/binary-tree-upside-down/http://blog.csdn.net/xudli/article/details/42362441/** *Definitionforbinarytree *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNoderight; *TreeNode(intx){val=x;} *} */ publicclassSolution{ publicT..
分类:其他好文   时间:2015-01-09 19:29:33    阅读次数:169
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!