update recursion

This commit is contained in:
ranwenjie
2021-11-10 16:27:32 +08:00
parent b70bfccac2
commit 0b2ae012d0
2 changed files with 52 additions and 1 deletions
+15
View File
@@ -20,6 +20,21 @@ struct SBinaryTreeNode // a node of the binary tree
};
```
二叉树递归框架
```Java
/* 二叉树遍历框架 */
void traverse(TreeNode root) {
// 前序遍历
traverse(root.left)
// 中序遍历
traverse(root.right)
// 后序遍历
}
```
## 二叉树翻转