You are viewing a single comment's thread. Return to all comments →
def levelOrder(self,root): queue = [root] for item in queue: if item.left: queue.append(item.left) if item.right: queue.append(item.right) print(" ".join([str(i.data) for i in queue]))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 23: BST Level-Order Traversal
You are viewing a single comment's thread. Return to all comments →