def bfs(self):
        '''
        Breadth-first search generator.  Yields `(node, parent)` for every
        node in the tree, beginning with `(self.root, None)`.
        '''
        yield (self.root, None)
        todo = deque([(self.root[char], self.root) for char in self.root])
        while todo:
            current, parent = todo.popleft()
            yield (current, parent)
            for char in current:
                todo.append((current[char], current))