arr [ ] is sequence of root to leaf path
int [ ] arr = { 5 , 8 , 6 , 7 } ; Node root = new Node ( 5 ) ; root . left = new Node ( 3 ) ; root . right = new Node ( 8 ) ; root . left . left = new Node ( 2 ) ; root . left . right = new Node ( 4 ) ; root . left . left . left = new Node ( 1 ) ; root . right . left = new Node ( 6 ) ; root . right . left . right = new Node ( 7 ) ; if ( existPath ( root , arr , 0 ) ) { Console . Write ( " Path ▁ Exists " ) ; } else { Console . Write ( " Path ▁ does ▁ not ▁ Exist " ) ; } } }