Function to store the path from root node to given node of the tree in path vector and then returns true if the path exists otherwise false
function FindPath ( root , key ) { if ( root == null ) return false ; path . push ( root . data ) ; if ( root . data == key ) return true ; if ( FindPath ( root . left , key ) || FindPath ( root . right , key ) ) return true ; path . pop ( ) ; return false ; }