当前位置:网站首页>Leetcode skimming: binary tree 03 (post order traversal of binary tree)
Leetcode skimming: binary tree 03 (post order traversal of binary tree)
2022-07-02 00:26:00 【Taotao can't learn English】
145. Postorder traversal of binary trees
package com.programmercarl.tree;
import java.util.ArrayList;
import java.util.List;
/** * @ClassName PostorderTraversal * @Descriotion TODO * @Author nitaotao * @Date 2022/7/1 15:27 * @Version 1.0 * 145. Postorder traversal of binary trees * https://leetcode.cn/problems/binary-tree-postorder-traversal/ **/
public class PostorderTraversal {
public List<Integer> postorderTraversal(TreeNode root) {
List<Integer> result = new ArrayList<Integer>();
traversal(root, result);
return result;
}
/** * After the sequence traversal * @param root * @param result */
public void traversal(TreeNode root, List<Integer> result) {
// Determine termination conditions
if (root == null) {
return;
}
// Left
traversal(root.left,result);
// Right
traversal(root.right,result);
// in
result.add(root.val);
}
}

边栏推荐
- LDR6035智能蓝牙音响可对手机设备持续充放电方案
- LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电
- 在证券账户上买基金安全吗?哪里可以买基金
- Kyushu cloud and Intel jointly released the smart campus private cloud framework, enabling new infrastructure for education
- Jielizhi, production line assembly link [chapter]
- 九州云与英特尔联合发布智慧校园私有云框架,赋能教育新基建
- Using multithreaded callable to query Oracle Database
- Ldr6035 smart Bluetooth audio can be charged and released (5.9.12.15.20v) fast charging and fast releasing device charging
- Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
- 【QT】对于Qt MSVC 2017无法编译的问题解决
猜你喜欢
![[cmake] cmake configuration in QT Creator](/img/e3/1cf76f88eaddb5d32184523dfb049c.png)
[cmake] cmake configuration in QT Creator

RPA tutorial 01: Excel automation from introduction to practice
![Jielizhi, production line assembly link [chapter]](/img/1d/d1736fad33c428e61f450aad512ce0.png)
Jielizhi, production line assembly link [chapter]

Relatively easy to understand PID understanding

export default 导出的对象,不能解构问题,和module.exports的区别
![[Qt] résoudre le problème que Qt msvc 2017 ne peut pas Compiler](/img/35/e458fd437a0bed4bace2d6d65c9ec8.png)
[Qt] résoudre le problème que Qt msvc 2017 ne peut pas Compiler

Leetcode 96 différents arbres de recherche binaires

使用多线程Callable查询oracle数据库

2022 pinduoduo details / pinduoduo product details / pinduoduo SKU details

Niuke - Practice 101 - reasoning clown
随机推荐
使用多线程Callable查询oracle数据库
An intern's journey to cnosdb
Multi table operation - one to one, one to many and many to many
Leetcode medium question sharing (5)
北京炒股开户选择手机办理安全吗?
使用htaccess文件禁止目录里的脚本执行权限
leetcode96不同的二叉搜索樹
Linux centos7 installation Oracle11g super perfect novice tutorial
Correlation - intra group correlation coefficient
2022拼多多详情/拼多多商品详情/拼多多sku详情
【QT】QtCreator卸载与安装(非正常状态)
LDR6035智能蓝牙音响可充可放(5.9.12.15.20V)快充快放设备充电
Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?
Is it safe to choose mobile phone for stock trading account opening in Beijing?
UDS bootloader of s32kxxx bootloader
[template] adaptive Simpson integral
Node——Egg 创建本地文件访问接口
Iota in golang
I would like to ask, which securities is better for securities account opening? Is it safe to open a mobile account?
USB-IF协会与各种接口的由来
