Skip to content

Latest commit

 

History

History
22 lines (20 loc) · 394 Bytes

File metadata and controls

22 lines (20 loc) · 394 Bytes

Given the binary tree and you have to find out the n-th node of inorder traversal.

Input : n = 4
              10
            /   \
           20     30
         /   \
        40     50
Output : 10
Inorder Traversal is : 40 20 50 10 30

Input :  n = 3
            7
          /   \
         2     3
             /   \
            8     5
Output : 8
Inorder: 2 7 8 3 5
3th node is 8