If current node is part of the path , then do reversing .
if ( left or right ) : NEW_LINE INDENT root . data = temp [ nextpos ] ; NEW_LINE nextpos += 1 NEW_LINE return ( left if left != None else right ) , temp , nextpos ; NEW_LINE DEDENT