Function to traverse a binary encoded path and return the value encountered after traversal .
int traversePath ( Node * root , vector < int > path ) { for ( int i = 0 ; i < path . size ( ) ; i ++ ) { int direction = path [ i ] ;