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
- 개발자
- Git
- react
- 코딩테스트
- 부스트캠프
- python
- boostcamp
- 알고리즘
- 백준
- Object
- Django
- Express
- 사이트
- 지속가능한개발자
- 배포
- vscode
- js
- array
- 5기
- 정보처리기사
- 코테
- 런타임에러
- 자바스크립트
- javascript
- 삼각형
- 실기
- Mac
- CSS
- node
- 네이버커넥트재단
Archives
- Today
- Total
개발 공부 기록
[python] heapq 본문
module import
import heapq
heap 생성
heap = []
원소 추가, 삭제
heapq.heappush(heap, 값) # 추가
print(heapq.heappop(heap)) # 삭제
응용
heapq.heappush(heap, (우선순위, 값))
참고
'취업 준비 > 코딩테스트' 카테고리의 다른 글
[python] enumerate (0) | 2020.09.20 |
---|---|
[python] 주요 연산자 시간복잡도 (0) | 2020.09.13 |
[python] 백준 1406 런타임 에러, 시간 초과 해결 (2) | 2020.09.06 |
[python] 재귀 호출 오류, 최대 재귀 깊이 늘려주기 (0) | 2020.09.03 |
[코테준비] Python int형 리스트 join하기 (0) | 2020.08.31 |
Comments