Let us create the tree as shown in the example
root = Node ( 12 ) NEW_LINE root . left = Node ( 5 ) NEW_LINE root . left . left = Node ( 3 ) NEW_LINE root . left . right = Node ( 9 ) NEW_LINE root . left . left . left = Node ( 1 ) NEW_LINE root . left . right . left = Node ( 2 ) NEW_LINE if ( check ( root ) ) : NEW_LINE INDENT print " Leaves ▁ are ▁ at ▁ same ▁ level " NEW_LINE DEDENT else : NEW_LINE INDENT print " Leaves ▁ are ▁ not ▁ at ▁ same ▁ level " NEW_LINE DEDENT