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