You are viewing a single comment's thread. Return to all comments →
def levelOrder(root): deck = deque() if not root: return None else: deck.append(root) while deck: x = deck.popleft() print x.data, if x.left: deck.append(x.left) if x.right: deck.append(x.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 →