码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
[leetcode-94-Binary Tree Inorder Traversal]
Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recur ...
分类:其他好文   时间:2017-04-04 19:08:20    阅读次数:117
【leetcode】Binary Tree Level Order Traversal
用三种方法写了一下,第二种有点意思,玩玩python了 ...
分类:其他好文   时间:2017-04-04 16:02:42    阅读次数:168
VS2013编译VTK7.1.1
1.下载VTK 从VTK官网可以下载Source,Data,以及Documentation:VTK Download VTK安装分为binary install和source code install两种方式,binary install可以下载vtk.exe直接安装VTK,开发直接在Tcl中进行; ...
分类:其他好文   时间:2017-04-04 00:04:49    阅读次数:1610
记录关于交叉编译器的一点知识
To cross-compile is to build on one platform a binary that will run on another platform. When speaking of cross-compilation, it is important to distin ...
分类:其他好文   时间:2017-04-03 16:24:49    阅读次数:182
[LeetCode]Unique Binary Search Trees
找值为1->n的所有可能的二叉树。 如果是找可能的数量而不需要列出所有可能时,可以用动态规划。 思路如下: 动态规划法:f(n)表示该子树中有n个数字可用来组成树枝f(0) = 1;空树f(1) = 1;树根f(2) = f(0)*f(1) + f(1)*f(0);当左子树有0个数,右子树右1个数的 ...
分类:其他好文   时间:2017-04-03 11:45:57    阅读次数:150
LeetCode 104. Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:其他好文   时间:2017-04-02 19:31:02    阅读次数:124
Binary Tree Level Order Traversal
思路一:使用非递归方式,当时还是需要注意每当一个算法写完后,检查是否处理到根节点或者list为空的情况 思路二:采用递归的方式,这里使用一个额外参数记录了层次遍历的深度 ...
分类:其他好文   时间:2017-04-02 11:37:50    阅读次数:146
【LeetCode】106. Construct Binary Tree from Inorder and Postorder Traversal-通过中序和后续遍历还原二叉树
一、描述: 二、思路: 二叉树的中序遍历和前序遍历或和后续遍历能唯一确定一节课二叉树,即2中还原方式都需要中序遍历才能完成; 设二叉树的前序遍历序列为{1, 2, 4, 5, 3, 6},中序遍历序列为{4,2,5,1, 3, 6}:(红色标记表示以还原节点!!!) (1)-前序遍历的第一个节点是二 ...
分类:其他好文   时间:2017-04-02 11:34:43    阅读次数:164
Binary Tree Postorder Traversal
思路一:递归版本 思路二:非递归版本,前序遍历中使用了一个额外的指针,这里使用times记录节点出栈的次数,更加方便直观 ...
分类:其他好文   时间:2017-04-02 11:04:29    阅读次数:118
04-树5 Root of AVL Tree + AVL树操作集
An 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 most one; if at any ...
分类:其他好文   时间:2017-04-02 00:47:26    阅读次数:279
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!