front / back / next_front [terminology]
Terminology¶
Usage¶
- Use for bidirectional search frontiers.
frontandbackrepresent the active layers growing from opposite ends.next_frontstores the following BFS layer.- Do not use
landr, because these values are sets rather than pointers.
front = {beginWord}
back = {endWord}
# ...
while front:
# ...
next_front = set()
# ...
front = next_front
See 127. Word Ladder.