Binary Tree Inorder Traversal
Description
Given the root of a binary tree, return its inorder traversal of the node values.
Inorder traversal visits the nodes in this order:
Left → Root → Right
Example 1
Input
3 1 2 3
Output
2 1 3
Explanation
The binary tree is:
1
/ \
2 3
Inorder traversal:
Left → Root → Right 2 → 1 → 3
Example 2
Input
5 1 2 3 4 5
Output
4 2 5 1 3
Explanation
The tree is:
1
/ \
2 3
/ \
4 5
Therefore, the inorder traversal is:
4 → 2 → 5 → 1 → 3
Constraints
Hints:
Hint 1
In inorder traversal, always process the left subtree first, then the current node, and finally the right subtree.
Hint 2
You can solve this recursively by calling inorder traversal on the left and right children.
Author & Technical Reviewer
Technically reviewed by: ExamAdda Technical Review Team
Technical Reviewers, ExamAdda
Software engineers at ExamAdda who check every article's definitions, complexity claims and code examples before and after publishing.
Published
Aug 10, 2026
Last updated
Aug 10, 2026
Content Verification Methodology
Definitions and complexity claims were checked against authoritative computer-science references. Code examples were compiled and tested with standard, boundary and edge-case inputs.
Expected Output