construct a tree
root = newNode ( 1 ) NEW_LINE root . left = newNode ( 2 ) NEW_LINE root . right = newNode ( 3 ) NEW_LINE root . left . right = newNode ( 4 ) NEW_LINE root . right . left = newNode ( 5 ) NEW_LINE root . right . right = newNode ( 6 ) NEW_LINE result = checkLevelLeafNode ( root ) NEW_LINE if ( result ) : NEW_LINE INDENT print ( " All ▁ leaf ▁ nodes ▁ are ▁ at ▁ same ▁ level " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Leaf ▁ nodes ▁ not ▁ at ▁ same ▁ level " ) NEW_LINE DEDENT