You are viewing a single comment's thread. Return to all comments →
Solution in python 3:
def levelOrder(root): if root is None: return
queue = [root] while queue: node = queue.pop(0) print(node.info, end=" ") if node.left: queue.append(node.left) if node.right: queue.append(node.right)
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Level Order Traversal
You are viewing a single comment's thread. Return to all comments →
Solution in python 3:
def levelOrder(root): if root is None: return