print level by level
def printLevelByLevel ( root ) : NEW_LINE INDENT if root : NEW_LINE INDENT node = root NEW_LINE while node : NEW_LINE INDENT print ( ' { } ' . format ( node . data ) , end = ' ▁ ' ) NEW_LINE node = node . nextRight NEW_LINE DEDENT print ( ) NEW_LINE if root . left : NEW_LINE INDENT printLevelByLevel ( root . left ) NEW_LINE DEDENT else : NEW_LINE INDENT printLevelByLevel ( root . right ) NEW_LINE DEDENT DEDENT DEDENT