文章 2023-11-01 来自:开发者社区

Leetcode Binary Tree Postorder Traversal(面试题推荐)

此题来自leetcode   https://oj.leetcode.com/problems/binary-tree-postorder-traversal/Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, ....

文章 2023-01-07 来自:开发者社区

LeetCode 102. 二叉树的层序遍历 Binary Tree Level Order Traversal

LeetCode 102. 二叉树的层序遍历 Binary Tree Level Order TraversalTable of Contents一、中文版二、英文版三、My answer四、解题报告一、中文版给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。 示例:二叉树:[3,9,20,null,null,15,7],   &...

文章 2023-01-05 来自:开发者社区

LeetCode 145. Binary Tree Postorder Traversal

DescriptionGiven a binary tree, return the postorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3 Output: [3,2,1] Follow up: Recursive solution is trivial, ...

LeetCode 145. Binary Tree Postorder Traversal
文章 2023-01-05 来自:开发者社区

LeetCode 107. Binary Tree Level Order Traversal II

DescriptionGiven a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,....

LeetCode 107. Binary Tree Level Order Traversal II
文章 2023-01-05 来自:开发者社区

LeetCode 102. Binary Tree Level Order Traversal

DescriptionGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7],3 / \ 9 20 ...

LeetCode 102. Binary Tree Level Order Traversal
文章 2019-08-20 来自:开发者社区

LeetCode 94:二叉树的中序遍历 Binary Tree Inorder Traversal

题目: 给定一个二叉树,返回它的中序 遍历。 Given a binary tree, return the inorder traversal of its nodes' values. 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [1,3,2] 进阶: 递归算法很简单,你可以通过迭代算法完成吗? Follow up: Recu...

文章 2018-01-16 来自:开发者社区

[LeetCode] Construct Binary Tree from Inorder and Postorder Traversal

链接:https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/description/难度:Medium题目:106. Construct Binary Tree from Inorder and Postorder Traversal Given inorder and p....

文章 2018-01-16 来自:开发者社区

[LeetCode] Construct Binary Tree from Preorder and Inorder Traversal

链接:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/description/难度:Medium题目:105. Construct Binary Tree from Preorder and Inorder Traversal Given preorder and in....

文章 2017-12-15 来自:开发者社区

[LeetCode] Binary Tree Vertical Order Traversal 二叉树的竖直遍历

Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the same row and column, the order should be fr...

文章 2017-12-11 来自:开发者社区

[LeetCode] 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 tree {3,9,20,#,#,15,7}, 3 / \ 9 20 / \ .....

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注