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
- level3
- level 3
- 너비 우선 탐색
- group by
- 자바스크립트
- Python
- javascript
- 스택
- softeer
- Lv. 1
- 문자열
- 다이나믹프로그래밍
- dfs
- SQL 고득점 KIT
- Lv. 3
- Lv. 2
- 타입스크립트
- DP
- Dynamic Programming
- bfs
- Java
- 브루트포스
- Lv. 0
- programmers
- 프로그래머스
- 소프티어
- Stack
- 파이썬
- C언어
- Typescript
Archives
- Today
- Total
목록힙구현 (1)
몸과 마음이 건전한 SW 개발자
자바스크립트 Heap [최소힙 구현]
구현 class heapq { constructor() { this.heap = []; }; size() { return this.heap.length; }; swap(left, right) { [this.heap[left], this.heap[right]] = [this.heap[right], this.heap[left]]; }; heappush(value) { this.heap.push(value); this.bubbleUp(); }; bubbleUp() { let son = this.heap.length - 1; let parent = Math.floor((son - 1) / 2); while (parent >= 0 && this.heap[son] < this.heap[parent]) { this...
개발 언어 입문/자바스크립트 문법
2024. 3. 25. 02:49