mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
refactor: 0102.二叉树的层序遍历.md
This commit is contained in:
@ -693,7 +693,8 @@ func levelOrderBottom(root *TreeNode) [][]int {
|
||||
|
||||
```javascript
|
||||
var levelOrderBottom = function (root) {
|
||||
let res = [], queue = [];
|
||||
let res = [],
|
||||
queue = [];
|
||||
queue.push(root);
|
||||
while (queue.length && root !== null) {
|
||||
// 存放当前层级节点数组
|
||||
@ -713,6 +714,7 @@ var levelOrderBottom = function(root) {
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
```
|
||||
|
||||
#### TypeScript:
|
||||
|
@ -71,7 +71,7 @@
|
||||
|
||||
有递归的地方就有回溯,那么回溯在哪里呢?
|
||||
|
||||
就地递归函数的下面,例如如下代码:
|
||||
就递归函数的下面,例如如下代码:
|
||||
|
||||
```cpp
|
||||
void dfs(参数) {
|
||||
|
Reference in New Issue
Block a user