Inorder Traversal
Given a binary tree root, return an inorder traversal of root as a list.
Bonus: Can you do this iteratively?
Constraints
n ≤ 100,000wherenis the number of nodes inroot
https://binarysearch.com/problems/Inorder-Traversal
Examples
Example 1
Input
- root =
Output
- answer =
[1, 80, 159]
Leave a comment