deque

C#을 쓰면서 주로 list, dictionary등을 사용해왔다.. 물론 Queue도 메시지 처리하면서 많이 썼다 (중간에 메시지 처리를 안하는 것을 방지 하기 위하여) Python에서도 queue, list 등 모두다 지원하지만.. 추가로 Deque라는 것을 지원한다. 코드 ㄱ from collections import deque deq = deque() # Add element to the start deq.appendleft(10) # Add element to the end deq.append(0) # Pop element from the start deq.popleft() # Pop element from the end deq.pop() deque는 queue와는 다르게 맨 끝에 추가하거나, 맨..
C#을 쓰면서 주로 list, dictionary등을 사용해왔다.. 물론 Queue도 메시지 처리하면서 많이 썼다 (중간에 메시지 처리를 안하는 것을 방지 하기 위하여) Python에서도 queue, list 등 모두다 지원하지만.. 추가로 Deque라는 것을 지원한다. 코드 ㄱ from collections import deque deq = deque() # Add element to the start deq.appendleft(10) # Add element to the end deq.append(0) # Pop element from the start deq.popleft() # Pop element from the end deq.pop() deque는 queue와는 다르게 맨 끝에 추가하거나, 맨..
주지님
'deque' 태그의 글 목록