码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
【leetcode】Binary Tree Right Side View
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For exam...
分类:其他好文   时间:2015-05-22 11:18:29    阅读次数:107
【Leetcode】【Medium】Binary Tree Inorder Traversal
Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note...
分类:其他好文   时间:2015-05-22 09:22:37    阅读次数:110
【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
Uva 122 Trees on the level
题目输入一些结点,要求建立一颗二叉树,这些结点输入方式方式是(value, pos),value代表一个正int型的数,pos是一个仅由L与R组成的字符串,L代表左子树,R代表右子树,LRR代表root(根结点)的左子树的左子树的右子树的根结点,此结点的值即为value。思路:采用一个map来保存结...
分类:其他好文   时间:2015-05-22 00:15:13    阅读次数:171
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!