当前位置:网站首页>LeetCode 94. Middle order traversal of binary tree
LeetCode 94. Middle order traversal of binary tree
2022-06-26 04:35:00 【Ashby's daily life】
https://leetcode-cn.com/problems/binary-tree-inorder-traversal/
In the sequence traversal : Left root right
public List<Integer> inorderTraversal(TreeNode root) {
List<Integer> list = new ArrayList<>();
inorder(root, list);
return list;
}
public void inorder(TreeNode root, List<Integer> list) {
if (root == null) {
return;
}
inorder(root.left,list);
list.add(root.val);
inorder(root.right, list);
}
边栏推荐
- Database design (3): database maintenance and optimization
- Report on the "fourteenth five year plan" and future development direction of global and Chinese indoor vertical farms from 2022 to 2028
- Video label forbids downloading. The test is valid. Hide button. The test is valid at three points
- 1.12 learning summary
- SQL related knowledge - constraints
- Dameng database backup and restore
- Be a hard worker from today on
- Modify the number of Oracle connections
- Database design (I)
- Knowledge about SQL - DML
猜你喜欢
![PHP design function getmaxstr to find the longest symmetric string in a string - [original]](/img/45/d8dae9e605a2f411683db7a2d40d0b.jpg)
PHP design function getmaxstr to find the longest symmetric string in a string - [original]

mysql高级学习(跟着尚硅谷老师周阳学习)

MySQL enable logbin in Qunhui docker

Your requirements could not be resolved

pip 批量完全卸载包
![[Qunhui] this suite requires you to start PgSQL adapter service](/img/fb/1aea7eb833afc1a24531b612a98400.jpg)
[Qunhui] this suite requires you to start PgSQL adapter service

NPM installation tutorial

Etcd watch principle
![Alipay failed to verify the signature (sandbox test indicates fishing risk?) [original]](/img/64/c3bb27a3711a6f0cc7b281d1a961af.jpg)
Alipay failed to verify the signature (sandbox test indicates fishing risk?) [original]
![[Qunhui] Internet access + custom port](/img/7d/c00caeade209a48c8f44a4fecb59d5.jpg)
[Qunhui] Internet access + custom port
随机推荐
排序查询
Solution to composer error could not find package
numpy 通用函数
What are the advantages and risks of paper gold investment
PHP splits a string into arrays
2022 talent strategic transformation under the development trend of digital economy
PHP has the problem of using strtotime to obtain time in months and months [original]
Double buffer technology asynchronous log system
Be a hard worker from today on
Analysis report on development trend and market demand of global and Chinese molecular diagnostics industry from 2022 to 2028
Add, delete, modify and query curd in PHP native SQL
Sixtool- source code of multi-functional and all in one generation hanging assistant
List of provinces, cities and counties in China
Svn error command revert error previous operation has not finished; run ‘ cleanup‘ if
How to carry out word-of-mouth marketing for enterprises' products and services? Can word of mouth marketing be done on behalf of others?
Database design (3): database maintenance and optimization
08_SpingBoot 集成Redis
Report on operation mode and future development trend of China's refining and chemical market 2022-2028
Construction of art NFT trading platform | NFT mall
Install Damon database