码迷,mamicode.com
首页 >  
搜索关键字:preorder traversal    ( 1851个结果
LeetCode-144-Binary Tree Preorder Traversal
算法描述: Given a binary tree, return the preorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iter ...
分类:其他好文   时间:2019-02-06 18:35:55    阅读次数:109
LeetCode-105-Construct Binary Tree from Preorder and Inorder Traversal
算法描述: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For exa ...
分类:其他好文   时间:2019-02-03 11:08:11    阅读次数:193
LeetCode-106-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. For ex ...
分类:其他好文   时间:2019-02-03 10:41:35    阅读次数:198
LeetCode-102-Binary Tree Level Order Traversal
算法描述: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary t ...
分类:其他好文   时间:2019-02-03 10:40:28    阅读次数:184
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 leve ...
分类:其他好文   时间:2019-02-03 10:27:16    阅读次数:188
【leetcode】589. N-ary Tree Preorder Traversal
题目: Given an n-ary tree, return the preorder traversal of its nodes' values. For example, given a 3-ary tree: Return its preorder traversal as: [1,3,5 ...
分类:其他好文   时间:2019-02-02 12:44:49    阅读次数:221
LeetCode 解题报告
题目要求 Given an n-ary tree, return the postorder traversal of its nodes' values. 题目分析及思路 题目给出一棵N叉树,要求返回结点值的后序遍历。可以使用递归的方法做。因为是后序遍历,所以最后加入根结点的值。 python代码 ...
分类:其他好文   时间:2019-02-01 16:24:16    阅读次数:168
leetcode 144. Binary Tree Preorder Traversal 二叉树的前序遍历
前序遍历的递归解法: 方法一C++: 前序遍历的非递归方法: C++代码: ...
分类:其他好文   时间:2019-01-30 00:26:55    阅读次数:179
leetcode 590.N-ary Tree Postorder Traversal N叉树的后序遍历
递归方法 C++代码: ...
分类:其他好文   时间:2019-01-30 00:21:12    阅读次数:171
leetcode 94.Binary Tree Inorder Traversal 二叉树的中序遍历
递归算法C++代码: 非递归方法(迭代): C++代码: ...
分类:其他好文   时间:2019-01-29 11:00:13    阅读次数:136
1851条   上一页 1 ... 26 27 28 29 30 ... 186 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!