Skip to content

Instantly share code, notes, and snippets.

@mym0404
Created May 9, 2022 14:08
Show Gist options
  • Save mym0404/84e1371cd4e7be5e52e247f045976957 to your computer and use it in GitHub Desktop.
Save mym0404/84e1371cd4e7be5e52e247f045976957 to your computer and use it in GitHub Desktop.
from collections import deque
q = deque()
q.append(1) # O(1) back에 삽입
data = q.popleft() # O(1) front에서 데이터 가져오고 빼기
print(data) # 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment