添加 二叉树的迭代遍历 GO版本

添加 二叉树的迭代遍历 GO版本
This commit is contained in:
X-shuffle
2021-05-19 10:07:22 +08:00
committed by GitHub
parent 44c8ce6a4f
commit a57b6385c4

View File

@ -205,6 +205,7 @@ func preorderTraversal(root *TreeNode) []int {
> 迭代法后序遍历 > 迭代法后序遍历
```go ```go
//迭代法后序遍历
//后续遍历:左右中 //后续遍历:左右中
//压栈顺序:中右左(按照前序遍历思路),再反转结果数组 //压栈顺序:中右左(按照前序遍历思路),再反转结果数组
func postorderTraversal(root *TreeNode) []int { func postorderTraversal(root *TreeNode) []int {