def METHOD_NAME(self):
    """Iterate over nodes in breadth-first order."""
    queue = Queue()
    queue.put(self)
    while not queue.empty():
        node = queue.get()
        yield node
        if isinstance(node, Branch):
            for child in node.children:
                queue.put(child)