Skip to content

Latest commit

 

History

History

Nth Node in Inorder Traversal

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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