码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
【Leetcode】【Medium】Binary Tree Right Side View
Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:其他好文   时间:2015-05-22 09:22:05    阅读次数:84
【Leetcode】【Medium】Binary Tree Preorder Traversal
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].解题思...
分类:其他好文   时间:2015-05-22 09:20:44    阅读次数:94
Leetcode#114Flatten Binary Tree to Linked List
FlattenBinaryTreetoLinkedListTotalAccepted:46999TotalSubmissions:163018MySubmissionsQuestionSolutionGivenabinarytree,flattenittoalinkedlistin-place.Forexample,Given1 /25 /\346Theflattenedtreeshouldlooklike:1 2 3 4 5 6clicktoshowhints.分析:先..
分类:其他好文   时间:2015-05-22 01:57:56    阅读次数:91
Java for LeetCode 101 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: 1 / \ ...
分类:编程语言   时间:2015-05-22 01:54:09    阅读次数:189
Java for LeetCode 099 Recover Binary Search Tree
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.解题思路:先中序遍历找到mistake,然后替换即可,JAVA实现如下:...
分类:编程语言   时间:2015-05-22 01:49:49    阅读次数:111
leetcode_96题——Unique Binary Search Trees(动态规划)
Unique Binary Search TreesTotal Accepted:48675Total Submissions:134436My SubmissionsQuestionSolutionGivenn, how many structurally uniqueBST's(binary s...
分类:其他好文   时间:2015-05-22 00:24:09    阅读次数:103
【leetcode】Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree. 1 class Solut...
分类:其他好文   时间:2015-05-22 00:16:38    阅读次数:177
【leetcode】path sum--easy
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:其他好文   时间:2015-05-22 00:04:22    阅读次数:144
Java for LeetCode 098 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 n...
分类:编程语言   时间:2015-05-21 22:32:43    阅读次数:187
PAT Root of AVL Tree
Root of AVL TreeAn AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at mos...
分类:其他好文   时间:2015-05-21 22:02:09    阅读次数:159
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!