ARTS-5-算法练习-二叉树的前序遍历和后序遍历

练习4.1 根据后序和中序遍历输出先序遍历 (25分) 练习4.1 根据后序和中序遍历输出先序遍历 (25分) 本题要求根据给定的一棵二叉树的后序遍历和中序遍历结果,输出该树的先序遍历结果。 输入格式: 第一行给出正整数N(≤30),是树中结点的个数。随后两行,每行给出N个整数,分别对应后序遍历和中序遍历结果,数字间以空格分隔。题目保证输入正确对应一棵二叉树。 输出格式: 在一行中输出Preorder: 以及该树的先序遍历结果。数字间有1个空格,行末不得有多余空格。 输入样例: 7 2 3 1 5 7 6 4 1 2 3 4 5 6 7 输出样例: Preord 阅读详情

概述:

左耳朵耗子专栏《左耳听风》 用户自发每周完成一个ARTS:

1.Algorithm:每周至少做一个 leetcode 的算法题

2.Review:阅读并点评至少一篇英文技术文章

3.Tip:学习至少一个技术技巧

4.Share:分享一篇有观点和思考的技术文章

 

Algorithm
题目概述:

 

Given a binary tree, return the postorder traversal of its nodes' values.

For example:
Given binary tree{1,#,2,3},

   1
    \
     2
    /
   3

 

return[3,2,1].

 

思路分析:

这道题比较简单,可以通过递归的方式来实现后序遍历:

/**
 * Definition for binary tree
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */
import java.util.ArrayList;
public class Solution {
    
    
     ArrayList<Integer> list = new ArrayList<>();

    
    public ArrayList<Integer> postorderTraversal(TreeNode root) {
        postHandleNode( root);
        return list;
    }
    
    
    public void postHandleNode(TreeNode root){
        if(root==null){
            return ;
        }
        postHandleNode(root.left);
        postHandleNode(root.right);
        saveNode(root);
    }

    public void saveNode(TreeNode root){
        list.add(root.val);
    }
    
   
}

 

前序遍历

Given a binary tree, return the preorder traversal of its nodes' values.

For example:
Given binary tree{1,#,2,3},

   1
    \
     2
    /
   3

return[1,2,3].

/**
 * Definition for binary tree
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode(int x) { val = x; }
 * }
 */
import java.util.ArrayList;
public class Solution {
     ArrayList<Integer> list = new ArrayList<>();
    
    public ArrayList<Integer> preorderTraversal(TreeNode root) {
         preorderHandel(root);
        return list;
    }
    
        public void preorderHandel(TreeNode root) {
        if (root == null) {
            return;
        }
        saveNode(root);
        preorderHandel(root.left);
        preorderHandel(root.right);
        
    }



    public void saveNode(TreeNode root) {
        list.add(root.val);
    }

}

 

 

 

 

Halcon实战:5分钟搞定灰度图转热力图(附完整代码) 本文提供了一份Halcon实战指南,详细讲解如何在5分钟内将灰度图转换为直观的热力图。通过核心代码演示了利用HSV颜色模型进行色彩映射的原理与步骤,包括图像归一化、通道构建与空间转换,并附赠了深度图可视化等进阶应用技巧,帮助工程师快速提升图像分析效果。 阅读详情

相关推荐

Cheat Engine实战:多级指针逆向破解游戏内存的5个关键步骤(附C++模拟代码)

本文详细解析了使用Cheat Engine进行多级指针逆向破解游戏内存的完整流程。通过5个关键步骤,从定位动态地址到逐层追踪指针链,最终构建稳定指针路径。文章结合C++模拟代码,深入剖析了指针链的底层汇编原理,并提供了高级排查技巧,帮助读者掌握逆向工程中的核心内存追踪技术。

weixin_29239279的博客 306

【C语言习题】二叉树的先序、中序、后序遍历

构造一颗二叉树,输出其先序、中序、后序遍历序列。

qq_42910355的博客 1246

HBF凭什么能挑战HBM?

最近AI圈聊得最多的,除了大模型迭代,就是“算力瓶颈”。大家都知道GPU不够用、HBM抢疯了,但很少有人注意到,存储层正在酝酿一场革命——高带宽闪存(HBF)。今天就结合HBM之父Joungho Kim教授的最新观点,跟大家好好盘盘这门技术:它不是HBM的替代品,却可能重塑AI推理的游戏规则,甚至在2038年超越HBM市场规模。先澄清一个核心认知:HBF不是凭空冒出来的新技术,而是站在HBM肩膀上的“优化款”。

存储随笔 2130

二叉树的遍历(先序、中序、后序、层次)

参照王道数据结构辅导书以及哔哩哔哩大学的部分视频,对二叉树遍历的重要知识点进行归纳,并总结做题技巧。

kusunoki的博客 4万+

matlab/simulink saw谐振器仿真,基于Matlab的SAW模态耦合模型的仿真研究

第32卷 第 4 期Vol. 32 No. 4重 庆 理 工 大 学 学 报 (自然科学)Journal of Chongqing University of Technology( Natural Science)2 0 1 8年 4 月Apr. 2018doi : 10.3969/j . issn. 1674-8425(z). 2018.04.002本文引用格式 :李志鹏,马龙祥,孟旭,等•基...

weixin_36192634的博客 1386

网络系统实现技术之IPX与SPX

IPX/SPXNovell NetWare网络Novell公司为适应网络发展,将主机网络转换为PC网络,开发了Novell NetWare网络系统。该系统中基于客户机/服务器模式。以普通PC机做为客户机,以性能强大的服务器做为服务器,为客户机提供文件服务、数据库服务及其他服务。与前面的SNA模型一样,Novell NetWare也早于OSI模型,所以不能与OSI模型严格对应,但也有很明

成片的大树 9164

关于树的题目

1.一棵完全二叉树的第六层(根为1层)有8个叶结点,则该二叉树最多有多少结点? 答案:1+2+4+8+16+32+48=111个 2.一棵树度为4,度为4的结点有20个,度为3的结点有10个,度为2的结点有1个,度为1的结点有10个,求叶子结点数? 设n0n_0n0​为叶子结点数,n1n_1n1​为度为1的结点数,n2n_2n2​为度为2的结点数,n3n_3n3​为度为3的结点数,n4n_4n4​...

默的博客 3653

X猫免费小说安卓逆向分析

七猫免费小说安卓逆向分析 难度(♥♥) 文章目录七猫免费小说安卓逆向分析 难度(♥♥)1. 查壳2. 抓包分析3. sign1. Frida-rpc2. Native函数分析快3点了. 睡觉~ 白天再继续写! 1. 查壳 我这边使用的是ApkTool, 拖进去显示未加壳。 2. 抓包分析 POST https://xiaoshuo.wtzw.com/api/v1/login/index HTTP/1.1 net-env: 1 channel: qm-cbcpa056_wm is-white: 0 platf

Qiled的博客 4368

五道题带你搞懂二叉树(前,中,后,层)遍历

文章目录前言一、前序遍历二、中序遍历总结 前言 今天为大家带来的题均来自力扣,链接如下: 1.二叉树前序遍历 2.二叉树中序遍历 3.二叉树后续遍历 4.二叉树层序遍历 只要完全吃透这5道题,二叉树就可以轻松入门了 一、前序遍历 题目要求: 前序遍历顺序为:根-左子树-右子树 代码如下: void DST(struct TreeNode* root,int* ret,int* returnSize) { if(root==NULL) { return; }

bitezz的博客 1363

电化学-论文分享-NanoStat: An open source, fully wireless potentiostat

本文主要分享论文NanoStat: An open source, fully wireless potentiostat,并记录学习笔记。如果有条件,建议看原文最好。

分享技术笔记,希望对大家能够有一定的帮助,同时也通过归纳总结提升自己的个人能力。 2875

【滚雪球学数学建模】第1节·建模入门+三步法+案例

🎓 本文收录于 《滚雪球学数学建模》专栏,本专栏专注于从零基础出发,带你循序渐进掌握数学建模的核心方法与思维路径。通过“滚雪球式”学习法,从最简单的生活化案例到经典建模工具,再到省赛、国赛真题实战演练,逐步积累知识与技能,帮助你搭建完整的建模体系。无论你是刚接触建模的新生,还是希望提升科研与竞赛能力的学者与工程师,本专栏都将为你提供一条清晰、高效、可实操的建模成长路线,助力你快速进阶,突破难点,迈向数学建模竞赛与实际应用的更高峰 🚀!

**My Coding Family** 6413

ARTS Week 21

ARTS Week 21 人生就像一杯茶,不会苦一辈子,但总会苦一阵子。 Algoithm 从前序和后序遍历构造二叉树 概述 返回与给定的前序和后序遍历匹配的任何二叉树。 pre 和 post 遍历中的值是不同的正整数。 示例: 输入:pre = [1,2,4,5,3,6,7], post = [4,5,2,6,7,3,1] 输出:[1,2,3,4,5,6,7] 分析 前序遍历: 根节点 左子树 右子树 后序遍历 左子树 右子树 根节点 例如,如果最终的二叉树可以被序

weixin_38872236的博客 184

数学建模学习(120):使用Python实现基于AHP的供应商选择分析

使用Python实现基于AHP的供应商选择分析

全栈川川 912

Dimple在左耳听风ARTS打卡(十九)

所谓ARTS:每周至少做一个LeetCode的算法题;阅读并点评至少一篇英文技术文章;学习至少一个技术技巧;分享一篇有观点和思考的技术文章。(也就是Algorithm、R...

程序员小跃的专栏 273

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

ARTS Week 5

ARTS Week 5 自己来选择,不会后悔的路。 Algoithm 二叉树换成累加树 概述 给定一个二叉搜索树(Binary Search Tree),把它转换成为累加树(Greater Tree),使得每个节点的值是原来的节点值加上所有大于它的节点值之和。 例如: 输入: 原始二叉搜索树: 5 / \ 2 13 输出: 转换为累加树: 18 / \

weixin_38872236的博客 183

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

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

ARTS Week 16

ARTS Week 16 仰望星空 Algoithm 二叉树展开为链表 概述 给定一个二叉树,原地将它展开为一个单链表。 例如,给定二叉树 1 / \ 2 5 / \ \ 3 4 6 将其展开为: 1 \ 2 \ 3 \ 4 \ 5 \ 6 分析 先使用前序遍历,获取每一个指针的数据 将每一个节点的数据同步 coding # De

weixin_38872236的博客 145

深度学习工具包 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")

ARTS Week 19

ARTS Week 19 静水流深,沧笙踏歌 Algoithm 首个共同的祖先 概述 设计并实现一个算法,找出二叉树中某两个节点的第一个共同祖先。不得将其他的节点存储在另外的数据结构中。注意:这不一定是二叉搜索树。 例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4] 3 / \ 5 1 / \ / \ 6 2 0 8 / \ 7 4 示例 1: 输入: root = [3,5,1,6,2,0,8,null

weixin_38872236的博客 155

ARTS Week 18

ARTS Week 18 他死在一个谁都不知道角落我不想他的骨灰毫无意义。 Algoithm 找树左下角的值 概述 给定一个二叉树,在树的最后一行找到最左边的值。 示例 1: 输入: 2 / \ 1 3 输出: 1 示例 2: 输入: 1 / \ 2 3 / / \ 4 5 6 / 7 输出: 7 注意: 您可以假设树(即给定的根节点)不为 NUL

weixin_38872236的博客 196

ARTS挑战第十七周

Algorithm 【前序遍历,备忘录】96. 不同的二叉搜索树 使用helper(left,right)进行递归计算。构造二叉树为前序遍历过程. ​ 先选定root节点,确定root节点后,总的树的数量就是左子树的种类 x 右子树的种类 ​ |–如果left >= right 返回1(乘法) ​ |–枚举【left,right】闭区间的所有元素作为根节点i ​ |–sum+=helper(left,i-1)*helper(i+1,right) ​

超级码力 292

ARTS挑战第二周

第二周 Algorithm 652. 寻找重复的子树 重要的是如何比较两棵子树:序列化子树,这个过程需要后序遍历,因为直到左子树和右子树的序列化字符串才能直到以当前节点为根节点的序列化字符串。 然后用全局变量来记录出现过的序列化字符串,并且次形成后进行对比 230. 二叉搜索树中第K小的元素 中序遍历,使用全局变量记录当前节点的rank值,如果相等就用全局变量res记录结果。最后返回res 538. 把二叉搜索树转换为累加树 中序遍历,先右子树再左子树,使用全局变量记录当前累加值,然后root值

超级码力 366

ARTS for week1(20181019)

提醒本文预计阅读时间7分钟每周完成一个ARTS:每周至少做一个 LeetCode 的算法题、阅读并点评至少一篇英文技术文章、学习至少一个技术技巧、分享一篇有观点和思考的技术文章。(也就...

herongwei 的 BLOG 231

二叉树遍历(先序、中序、后序的区别)

先序、中序、后序三种遍历方法的节点访问顺序一致,得到的结果却不一样,原因在于: 先序:访问到一个节点后,即刻输出该节点的值,并继续遍历其左右子树。(根左右) 中序:访问到一个节点后,将其暂存,遍历完左子树后,再输出该节点的值,然后遍历右子树。(左根右) 后序:访问到一个节点后,将其暂存,遍历完左右子树后,再输出该节点的值。(左右根) ...

轻舟已过万重山 5683

二叉树的先序、中序、后序三种遍历

原文地址:https://blog.youkuaiyun.com/eebaicai/article/details/89788098?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2

SeaSky_Steven的博客 1万+

数据结构练习题---先序遍历二叉树

描述 给定一颗二叉树,要求输出二叉树的深度以及先序遍历二叉树得到的序列。本题假设二叉树的结点数不超过1000。 输入 输入数据分为多组,第一行是测试数据的组数n,下面的n行分别代表一棵二叉树。每棵二叉树的结点均为正整数,数据为0代表当前结点为空,数据为-1代表二叉树数据输入结束,-1不作处理。二叉树的构造按照层次顺序(即第1层1个整数,第2层2个,第3层4个,第4层有8个......,如果某个结点不存在以0代替),比如输入: 1 2 0 3 4 -1得到的二叉树如下:

无知的渣渣的博客 7187

二叉树前序遍历、中序遍历、后序遍历、层序遍历的直观理解

0. 写在最前面 希望大家收藏: 本文持续更新地址:https://haoqchen.site/2018/05/23/go-through-binary-tree/     复习到二叉树,看到网上诸多博客文章各种绕,记得头晕。个人觉得数学、算法这些东西都是可以更直观简洁地表示,然后被记住的,并不需要靠死记硬背。 本文的程序基本来源于《大话数据结构》,个人感觉是一本非常好的书,推荐去看。 ...

白夜行的狼 45万+

刻意练习:LeetCode实战 -- 二叉树的后序遍历

背景 今天,第二期基础算法(Leetcode)刻意练习训练营 的打卡任务是二叉树的中序遍历,由于二叉树的遍历方式通常来说有四种:前序遍历、中序遍历、后序遍历以及层次遍历,而LeetCode也有二叉树的后序遍历题目,故一起写了。 题目 题号:145 难度:困难 https://leetcode-cn.com/problems/binary-tree-postorder-traversal/ ...

老马的程序人生 920
上一篇: 游戏服务器:到底使用UDP还是TCP
下一篇: 手写一套迷你版HTTP服务器
Danny_idea
博客等级 码龄10年 274粉丝 199原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值