144 Binary Tree Preorder Traversal
144. Binary Tree Preorder Traversal
1. Question
Given a binary tree, return thepreordertraversal of its nodes' values.
For example:
Given binary tree{1,#,2,3}
,
return[1,2,3]
.
2. Implementation
3. Time & Space Complexity
时间和空间复杂度都是O(n)
Last updated