Leetcode 107. 二叉树的层次遍历 II

用LTspice仿真CMOS反相器功耗?这份避坑指南能省你3天调试时间 本文详细介绍了如何使用LTspice准确仿真CMOS反相器的功耗,包括动态功耗、短路功耗和静态功耗的测量技巧。通过工程实践指南,帮助电子工程师避开常见陷阱,优化仿真参数设置,提升仿真结果的可靠性,节省调试时间。 阅读详情

题目

给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历)

在这里插入图片描述

解答

解法一:递归

其实本题还是 Leetcode 102. 二叉树的层次遍历 的一个变种题。

对于二叉树层序遍历的结果反向一下就好了。。

二叉树的层次遍历:点这里

代码
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */
class Solution {
    public List<List<Integer>> levelOrderBottom(TreeNode root) {
        List<List<Integer>> res = new ArrayList<>();
        levelOrderBottom(root, 0, res);
        
        for(int i = 0, j = res.size() - 1; i < j; i ++, j --) {
            List<Integer> temp = res.get(i);
            res.set(i, res.get(j));
            res.set(j, temp);
        }
        
        return res;        
    }
    
    private void levelOrderBottom(TreeNode node, int level, List<List<Integer>> res) {
        if(node == null) return;
        
        if(level == res.size()) {
            res.add(new LinkedList<>());
        }
        
        res.get(level).add(node.val);
        
        levelOrderBottom(node.left, level + 1, res);
        levelOrderBottom(node.right, level + 1, res);
    }
}
结果

在这里插入图片描述

解法二:队列 + BFS

同理,对二叉树层序遍历的非递归解法加个反向就好了。

如果不懂二叉树的层次遍历:点这里

代码
/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */
class Solution {
    public List<List<Integer>> levelOrderBottom(TreeNode root) {
        if(root == null) return new ArrayList<>();
        
        List<List<Integer>> res = new LinkedList<>();
        LinkedList<TreeNode> queue = new LinkedList<>();
        queue.offer(root);
        while(!queue.isEmpty()) {
            int size = queue.size();      
            List<Integer> cur = new ArrayList<>();
            while(size -- > 0) {
                TreeNode node = queue.poll();
                cur.add(node.val);
                
                if(node.left != null) {
                    queue.offer(node.left);
                }
                
                if(node.right != null) {
                    queue.offer(node.right);
                }
            }
            
            res.add(0, cur);
        }
        
        return res;        
    }
}
结果

在这里插入图片描述

保姆级教程:用杰理701N可视化SDK搞定ANC降噪配置(从工具到代码全流程) 本文提供了一份详细的杰理701N可视化SDK配置ANC降噪功能的教程,涵盖从开发环境搭建到代码集成的全流程。通过图形化工具和代码示例,帮助开发者快速掌握ANC参数配置技巧,优化降噪效果,解决常见问题。 阅读详情

相关推荐

Visual Studio报错TRK0005找不到CL.exe?三步彻底解决环境变量问题

本文详细解析了Visual Studio报错TRK0005找不到CL.exe的根本原因,并提供了三步彻底解决环境变量问题的方案。从验证安装完整性到配置永久环境变量,再到注册表级修复,帮助开发者建立健壮的开发环境配置体系,确保编译链稳定运行。

weixin_30839881的博客 459

[Leetcode] 107. 二叉树的层次遍历 II java

和102题类似,区别是要向结果中倒插list 。 [Leetcode] 102. 二叉树的层次遍历 java  给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其自底向上...

niceHou666的博客 2130

PackML工业标准解析:统一机器状态管理与数据交换的实践指南

在工业自动化与智能制造领域,实现设备间的互联互通与高效协同是核心挑战。这背后依赖于一套标准化的机器行为与数据交换规范,其原理在于通过定义统一的状态模型与接口协议,消除不同厂商设备间的“语言”隔阂。这项技术的核心价值在于大幅降低系统集成复杂度、提升运维效率与生产透明度,是构建数字化工厂的基石。其典型应用场景包括包装机械、离散制造产线等需要多设备协同的领域。本文聚焦的PackML(包装机械语言)标准,正是这一理念的杰出实践,它通过一套严谨的**状态机模型**和**数据标签(PackTags)** 体系,为机器提

weixin_30070339的博客 399

LeetCode 107:二叉树的层次遍历 II(java)

LeetCode 107:二叉树的层次遍历 II(java) 题目: 解答: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { ...

樊凯的博客 364

AutoCAD2014与ObjectARX开发环境搭建实战指南

本文提供了一份详细的AutoCAD2014与ObjectARX开发环境搭建实战指南。内容涵盖从AutoCAD2014、Visual Studio 2010及ObjectARX 2014 SDK的版本匹配与环境准备,到Wizard安装、编码问题解决、Visual Studio配置,并最终通过一个完整的绘图命令开发示例,手把手引导开发者创建并加载第一个可运行的ObjectARX插件,为后续深入开发奠定坚实基础。

weixin_28475533的博客 286

[VCS]门级仿真及SDF反标

摘要:门级仿真在STA工具普及后仍是验证的重要环节,主要用于检查SDC完备性、异步电路时序、网表完整性及为功耗分析提供波形。门级仿真分为不带时序反标的前仿和带SDF反标的后仿,后仿需加载SDF文件提供精确延时信息。VCS提供多种仿真选项控制时序检查行为,SDF反标可通过命令或系统函数实现。后仿需特别注意关闭notimingcheck选项以确保时序检查有效性,并建议检查SDF反标报告和波形验证延时一致性。

元直的博客 9787

二叉树的层次遍历(LeetCode第107题)

# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def levelOrderBot...

日积月累 353

FPGA 学习笔记:解决FPGA程序固化重新上电程序不运行的问题

FPGA 学习笔记:解决FPGA程序固化重新上电程序不运行的问题

坚韧与专注 1万+

LeetCode笔记——107二叉树层次遍历Ⅱ

题目: 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20], [3] ] 集合方面还是比较懵。。...

chenxy132的博客 615

【QGIS入门实战精品教程】1.2:QGIS与ArcGIS的区别和联系

以下是GISGeography官方给出的两者之间的27点比较(译): 官方网址:https://gisgeography.com/qgis-arcgis-differences/ 1.QGIS容纳更多的数据格式 ArcGIS没有支持所有的数据格式,毫无疑问,QGIS在处理各种类型的数据时非常顺手,QGIS在数据格式方面是个多面手,在使用数据方面是它的长处。 QGIS使用GDAL/OGR库来读取和写入地理信息数据格式,支持超过70种矢量格式。QGIS一开始就是为了与PostGIS协作而诞生的,而支持的名单.

智慧空间实验室 2040

第三章-python基础语法

有C语言基础应该这样学 Python。

qq_46187594的博客 1175

Leetcode 107. 二叉树的层次遍历 II 解题思路及C++实现

解题思路: 使用队列实现二叉树的层序遍历,因为题目中要求每一层的val存储在一个vector中,所以在内循环中,还需要一个队列,用以存储更新每一层的节点。 在最后,需要将得到的res数组逆序。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *lef...

PaniniGu的博客 480

R语言基于机器学习三分类结果、计算三分类混淆矩阵、计算每一个类别对应的特异度(specificity)、灵敏度(sensitivity)、PPV、NPV

R语言基于机器学习三分类结果、计算三分类混淆矩阵、计算每一个类别对应的特异度(specificity)、灵敏度(sensitivity)、PPV、NPV

data+scenario+science+insight 644

LeetCode 力扣 107. 二叉树的层次遍历 II

题目描述(简单难度) 树的层次遍历,和 102 题 的不同之处是,之前输出的数组顺序是从根部一层一层的输出,现在是从底部,一层一层的输出。 解法一 DFS 把 102 题 的DFS贴过来看一下。 public List<List<Integer>> levelOrder(TreeNode root) { List<List<Integer>&gt...

wind_liang的博客 891

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

LeetCode 力扣 107. 二叉树的层次遍历 II BFS树经典例题

大家觉得写还可以,可以点赞、收藏、关注一下吧! 也可以到我的个人博客参观一下,估计近几年都会一直更新!和我做个朋友吧!https://motongxue.cn 文章目录107. 二叉树的层次遍历 II题目描述样例分析提交结果 107. 二叉树的层次遍历 II 题目描述 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 样例 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \

motongxue的博客 226

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

leetcode 107.二叉树的层次遍历II

leetcode 107.二叉树的层次遍历II 题目描述 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20], [...

EngineerHe的博客 644

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

力扣leetcode 107. 二叉树的层次遍历 II java

/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ class Solution { publ...

izhxxx的博客 194

Leetcode107. 二叉树的层次遍历 II

Leetcode107. 二叉树的层次遍历 II 题目: 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7],        3       /  \   9  20 ...

会流泪de鱼的博客 139

【LeetCode】TO107. 二叉树的层次遍历 II

【LeetCode】TO107. 二叉树的层次遍历 II 难度: Easy 1. 题目描述 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7], 3 / 9 20 / 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20], [3] ] 2...

weixin_40701016的博客 148

LeetCode 第107题 二叉树的层次遍历II

给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历)例如:给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7返回其自底向上的层次遍历为:[ [15,7], [9,20], [3]] 思路: 先递归层次遍历 然后将res倒置 1 class...

weixin_30709809的博客 147

leetcode 107. 二叉树的层次遍历 II

leetcode 107. 二叉树的层次遍历 II 题目详情 题目链接 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20], [3] ] 我的代码 /** * Definition for a binary tree node. * struct TreeNode

qq_33789406的博客 92

leetcode-107 | 二叉树的层次遍历 II

title: leetcode-107 | 二叉树的层次遍历 II date: 2019-9-15 09:34:323 comments: true categories: “leetcode” toc: false tags: - leetcode 简单难度 - 二叉树 107. 二叉树的层次遍历 II 题目描述 给定一个二叉树,返回其按层次遍历的节点值。 (即逐层地,从左到右访问所有节点)...

梦否 368

以勒先生刷力扣之:107. 二叉树的层次遍历 II

107. 二叉树的层次遍历 II 题目 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 这个题和我上一篇的102. 二叉树的层序遍历(一)是异曲同工的,建议先去看我的上一篇,解释详细 这个题仍然是可以用两种方法来的,但是返回的时候要求是从底部往上面返回,那么就说明在添加list的时候要倒着添加,list有一个add方法是先写索引,再写上插入的元素。所以这就是和上面那个题的区别,建议先看上一篇的解释,再看接下来的代码,比较不同之处。 BFS pu

qq_40875283的博客 234

Leetcode 107. 二叉树的层次遍历 II C++

Leetcode 107. 二叉树的层次遍历 II 题目 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 测试样例 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20], [3] ] 题解 dfs遍历,根据当前层数high和数组的大小n,可以确定当前层数在数组中的下标为n-high

weixin_43750513的博客 257

LeetCode-107、二叉树的层次遍历 II-简单

LeetCode-107、二叉树的层次遍历 II-简单 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 例如: 给定二叉树 [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20]...

clover_my的博客 91

LeetCode107. 二叉树的层次遍历 II

LeetCode107. 二叉树的层次遍历 II 1.题目 给定一个二叉树,返回其节点值自底向上的层次遍历。 (即按从叶子节点所在层到根节点所在的层,逐层从左向右遍历) 2.示例 给定二叉树 [3,9,20,null,null,15,7] 3 / \ 9 20 / \ 15 7 返回其自底向上的层次遍历为: [ [15,7], [9,20], [...

七小琦 167
上一篇: Leetcode 104. 二叉树的最大深度
下一篇: Leetcode 108. 将有序数组转换为二叉搜索树
一纸浮萍
博客等级 码龄9年 11粉丝 103原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值