码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
1020. Tree Traversals (25)
根据两种遍历方式建立二叉树层遍历二叉树时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueSuppose that all the keys in a binary tree are distinct positive integers...
分类:其他好文   时间:2015-12-06 11:20:08    阅读次数:168
1043. Is It a Binary Search Tree (25)
时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, Yue(二叉树建立方法)A Binary Search Tree (BST) is recursively defined as a binary tree which has the fo...
分类:其他好文   时间:2015-12-06 11:20:07    阅读次数:371
[LeetCode]Construct Binary Tree from Preorder and Inorder Traversal
public class Solution { public TreeNode buildTree(int[] preorder, int[] inorder) { int length = preorder.length; if (length == 0) { ...
分类:其他好文   时间:2015-12-06 07:28:54    阅读次数:176
1043. Is It a Binary Search Tree (25)【二叉树】——PAT (Advanced Level) Practise
题目信息1043. Is It a Binary Search Tree (25)时间限制400 ms 内存限制65536 kB 代码长度限制16000 BA Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of...
分类:其他好文   时间:2015-12-06 01:48:39    阅读次数:167
[LeetCode]Balanced Binary Tree
题目描述:(链接)Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which ...
分类:其他好文   时间:2015-12-05 14:26:32    阅读次数:128
[LeetCode]Invert Binary Tree
public class Solution { public TreeNode invertTree(TreeNode root) { if (root == null) { return root; } TreeNode tmp...
分类:其他好文   时间:2015-12-05 14:23:45    阅读次数:125
[LeetCode]Symmetric Tree
题目描述:(链接)Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: ...
分类:其他好文   时间:2015-12-05 14:20:26    阅读次数:154
89. Gray Code (Bit)
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb...
分类:其他好文   时间:2015-12-05 12:44:50    阅读次数:115
[LeetCode]Construct Binary Tree from Inorder and Postorder Traversal
public class Solution { public TreeNode buildTree(int[] inorder, int[] postorder) { return helper(inorder, postorder, 0, inorder.length - 1,...
分类:其他好文   时间:2015-12-05 11:07:56    阅读次数:122
interview collect
1. binary tree inorder traversal 不能用recursive写 (LC原题)2. 比如有个数组F={1,3, 4, 5, 2, 0}, A=3, 那么F[A]=5, F[F[A]]=0, F[F[F[A]]]=1....这样下去求第N个数是多少. from: 1poin...
分类:其他好文   时间:2015-12-05 11:06:38    阅读次数:209
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!