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