67.🌟Binary Tree Inorder Traversal
1.Description(Easy)
Given a binary tree, return the inorder traversal of its nodes' values.
Example
Given binary tree {1,#,2,3}
,
return [1,3,2]
.
Can you do it without recursion?
2.Code
先依次把left都压进栈中,再依次pop顺便遍历right,并再次把他们left全部压进栈中.
Last updated