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
- Subject
- 프래그먼트
- observable
- 자바
- 옵셔널
- 풀이
- 리스트뷰
- View
- 차이
- weak
- 구조체
- RxSwift
- 알고리즘
- 안드로이드
- async
- 클로저
- 이스케이핑
- rx
- ios
- Self
- 연산자
- 백준
- 해시
- 스위프트
- concurrency
- Swift
- 프로그래머스
- 생명주기
- noncopyable
- 프로퍼티
Archives
- Today
- Total
목록우선순위큐 (1)
study record
[프로그래머스-자바] 힙 Heap
더 맵게 PriorityQueue 를 사용하는 문제 heap은 정렬하지 않아도 peek()이나 poll()하면 가장 작은 값이 나온다. 힙은 우선순위 큐를 위해 만들어진 자료구조로, 부모노드 키 값이 자식 노드 키 값보다 항상 크거나 작다. import java.util.PriorityQueue; public class Spicer { public int solution(int[] scoville, int K) { int answer = 0; PriorityQueue heap = new PriorityQueue(); for (int i = 0; i K) { if(heap.siz..
알고리즘
2021. 5. 4. 10:52