Allen Downey on Twitter: "If you search for "python breadth first search", a substantial majority of the implementations you find are accidentally quadratic. Should be O(n+m), instead they are O(n^2). Here's the
Python's deque: Implement Efficient Queues and Stacks – Real Python
Implementing Queues in Python | Queue | Prepbytes
Time Complexity] Python - Deque vs List performance comparison (append, appendleft, pop, popleft)