码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
bfs-dfs-bst
/**  * Definition for binary tree  * struct TreeNode {  *     int val;  *     TreeNode *left;  *     TreeNode *right;  *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}  * }; ...
分类:其他好文   时间:2015-01-10 18:20:29    阅读次数:181
Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: Given binary ...
分类:其他好文   时间:2015-01-10 18:17:08    阅读次数:177
Binary Search Tree Iterator 173
题目描述:对于一个二叉查找树,设计一个迭代器,每次调用会返回下一个最小值题目分析:没什么好说的二叉树的先序遍历代码: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * Tre...
分类:其他好文   时间:2015-01-10 17:55:11    阅读次数:203
Maximum Depth of Binary Tree
求树的深度...
分类:其他好文   时间:2015-01-10 16:41:38    阅读次数:94
[leetcode] Binary Tree Zigzag Level Order Traversal
Binary Tree Zigzag Level Order TraversalGiven a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then...
分类:其他好文   时间:2015-01-10 16:35:50    阅读次数:155
[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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!