Dsa
Trees
Warm-up
InOrder Traversal
Perform an in-order traversal of a binary tree and print the values in a single line, separated by spaces. The input format is the same: first an integer N followed by N lines of node value and child indices. Print the in-order traversal result of the tree.
Example Input:
3
1 2 3
2 0 0
3 0 0
Example Output:
2 1 3
Key concepts
treestraversalinorder
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now