东黑布衣,流浪幽燕。 真诚善良,值得信赖。
全部博文(327)
分类: BSD
2019-01-01 23:07:23
Given a binary tree, return the inorder traversal of its nodes' values.
Example:
Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2]
Follow up: Recursive solution is trivial, could you do it iteratively?
Given a binary tree, return the preorder traversal of its nodes' values.
Example:
Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3]
Follow up: Recursive solution is trivial, could you do it iteratively?