Let us create binary tree given in the above example
root = Node ( ) NEW_LINE root = newNode ( 1 ) NEW_LINE root . left = newNode ( 2 ) NEW_LINE root . right = newNode ( 3 ) NEW_LINE root . left . left = newNode ( 4 ) NEW_LINE root . left . right = newNode ( 5 ) NEW_LINE root . right . left = newNode ( 6 ) NEW_LINE root . right . right = newNode ( 7 ) NEW_LINE root . left . left . left = newNode ( 8 ) NEW_LINE root . right . left . left = newNode ( 9 ) NEW_LINE root . right . left . right = newNode ( 10 ) NEW_LINE turn = numberOfTurn ( root , 5 , 10 ) NEW_LINE if turn : NEW_LINE INDENT print ( turn ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Not ▁ possible " ) NEW_LINE DEDENT