We’re preparing your current view and syncing the latest data.
Given the root of a binary tree, return the inorder traversal of its nodes' values. Inorder traversal visits the left subtree first, then the current node, and finally the right subtree.
The input consists of the root node of a binary tree.
Return a list or array of integers representing the inorder traversal of the binary tree nodes.
The number of nodes in the tree is in the range [1, 10^4]. Node values are integers.
Example 1
Input
Root = [1,null,2,3]
Output
[1,3,2]
Explanation
The inorder traversal visits nodes in the order left, root, right. For the given tree, the traversal is 1, 3, 2.