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 |
Tags
- join
- Lv. 0
- 자바스크립트
- bfs
- 파이썬
- 너비 우선 탐색
- SQL 고득점 KIT
- Python
- Lv. 2
- javascript
- SQL
- Java
- Lv. 1
- dfs
- Dynamic Programming
- DP
- 소프티어
- softeer
- 깊이 우선 탐색
- group by
- 오블완
- 동적계획법
- Lv. 3
- programmers
- 프로그래머스
- level 3
- C언어
- 티스토리챌린지
- select
- LEVEL 2
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