You are viewing a single comment's thread. Return to all comments →
PYTHON SOLUTION:
def levelOrder(root): queue = [] queue.append(root) while(len(queue)>0): node = queue.pop(0) print node.data, 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 →
PYTHON SOLUTION: