deque
-
백준 10866번 : 덱 (Python, 파이썬) - 자료구조 덱(Deque)카테고리 없음 2019. 1. 14. 23:17
https://www.acmicpc.net/problem/10866 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455class deque: def __init__(self): self.items = [] def push_front(self,x): self.items.insert(0,x) def pop_front(self): if len(self.items) == 0: return -1 else: return self.items.pop(0) def push_back(self,x): self.items.append(x) def pop_back(self): if len(self...