❮ Lists
❯
Queue and Stack
Stack:
append pop
Queue:
append pop(0)
from collections import deque
Stack
fruits.append(...) fruits.pop()
Queue
fruits = deque() fruits.append(...) fruits.popleft()
Stack:
append pop
Queue:
append pop(0)
from collections import deque
Stack
fruits.append(...) fruits.pop()
Queue
fruits = deque() fruits.append(...) fruits.popleft()