$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #45

Fill the double-ended queue used for BFS.

from collections import deque
q = ____()

Answer: deque (also accepted: deque)

deque gives O(1) pops from both ends for BFS.
Play Problem Solving ▸