deque() object: faster appends and pops from the left side but slower lookups in the middle. : Deque « Data Structure « Python






deque() object: faster appends and pops from the left side but slower lookups in the middle.

deque() object: faster appends and pops from the left side but slower lookups in the middle.


from collections import deque
d = deque(["A", "B", "C"])
d.append("D")
print "Handling", d.popleft()


           
       

Related examples in the same category