Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 게임
- 동기
- JS #프로젝트
- eport
- 참고블로그
- addEventListener
- object
- sql
- json
- await
- 비동기
- promise
- slow and steady
- prj
- database
- db
- async
- webpack
- js
- Import
- callback
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- ajax
- Project
- Porject
- setTimeout()
- 혼프
- execCommand
- mysql
- https://m.blog.naver.com/tt2t2am1118/221010125300
Archives
- Today
- Total
C-log
심심풀이 땅콩🥜 : 큐(Queue) 본문
728x90
큐는 Enqueue와 Dequeue 두가지가 있다. 각 두 코드를 살펴보자.
deque.py
from collections import deque
queue = deque()
queue.append(1)
queue.append(2)
queue.append(3)
first_item = queue.popleft()
second_item = queue.popleft()
print(first_item)
print(second_item)
print(queue)
enque.py
from collections import deque
queue = deque()
queue.append(1)
queue.append(2)
queue.append(3)
first_item = queue.pop()
second_item = queue.pop()
print(first_item)
print(second_item)
print(queue)
728x90
'🧠Algorithm > 심심풀이 땅콩🥜' 카테고리의 다른 글
심심풀이 땅콩🥜 : 기본 입력과 출력 값 도출 하기 (0) | 2024.06.17 |
---|---|
심심풀이 땅콩🥜 : 스택(Stack) (0) | 2023.12.19 |
심심풀이 땅콩🥜 : 퀵 정렬(Quick Sort) (0) | 2023.09.26 |
심심풀이 땅콩🥜 : 삽입 정렬(Insertion Sort) (0) | 2023.09.19 |
심심풀이 땅콩🥜 : 버블 정렬(Bubble Sort) (1) | 2023.09.11 |
Comments