码迷,mamicode.com
首页 >  
搜索关键字:traversal    ( 1649个结果
LeetCode--Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Could you devis...
分类:其他好文   时间:2015-01-14 09:53:16    阅读次数:154
LeetCode--Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key.Th...
分类:其他好文   时间:2015-01-14 09:52:48    阅读次数:161
LeetCide--Same Tree
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. /** * Defin...
分类:其他好文   时间:2015-01-14 09:48:40    阅读次数:139
LeetCode--Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,3,2]. Note: Recursive solutio...
分类:其他好文   时间:2015-01-13 19:51:27    阅读次数:142
[leetcode]103 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 ...
分类:其他好文   时间:2015-01-13 19:49:51    阅读次数:152
[Leetcode][JAVA] Recover Binary Search Tree (Morris Inorder Traversal)
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n) space is ...
分类:编程语言   时间:2015-01-13 06:42:51    阅读次数:201
Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II...
分类:其他好文   时间:2015-01-10 18:19:33    阅读次数:128
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
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
[leetcode] Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Preorder and Inorder TraversalGiven preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume...
分类:其他好文   时间:2015-01-09 18:46:57    阅读次数:151
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!