mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 04:06:51 +08:00
添加 二叉树的迭代遍历 GO版本
添加 二叉树的迭代遍历 GO版本
This commit is contained in:
@ -205,6 +205,7 @@ func preorderTraversal(root *TreeNode) []int {
|
|||||||
> 迭代法后序遍历
|
> 迭代法后序遍历
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
//迭代法后序遍历
|
||||||
//后续遍历:左右中
|
//后续遍历:左右中
|
||||||
//压栈顺序:中右左(按照前序遍历思路),再反转结果数组
|
//压栈顺序:中右左(按照前序遍历思路),再反转结果数组
|
||||||
func postorderTraversal(root *TreeNode) []int {
|
func postorderTraversal(root *TreeNode) []int {
|
||||||
|
Reference in New Issue
Block a user