In case there are elements in the Binary tree , perform a level order traversal using a Queue
Q = [ ] NEW_LINE Q . append ( root ) NEW_LINE while ( len ( Q ) > 0 ) : NEW_LINE INDENT temp = Q [ - 1 ] NEW_LINE Q . pop ( ) NEW_LINE DEDENT