You are viewing a single comment's thread. Return to all comments →
Little more modification (shortest version I could do):
def levelOrder(root): q = [root] while q: n = q.pop(0) print n.data, if n.left: q.append(n.left) if n.right: q.append(n.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 →
Little more modification (shortest version I could do):