Dsa
Binary Search Tree
Warm-up
Inorder Traversal of BST
Write a program to output the inorder traversal of a binary search tree (BST). Inorder traversal visits the nodes in left-root-right order.
Input Format:
The first line contains an integer N - the number of nodes. The following N lines represent the values of the nodes in the BST.
Output Format:
Output a single line containing the values of the nodes in inorder traversal, separated by spaces.
Example:
Input:
5
3
1
4
2
5
Output:
1 2 3 4 5
Key concepts
binary_search_treetraversalinorder
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