Notice
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Spring Boot
- elasticsearch
- asyncconfigurer
- @FunctionalInterface
- java lambda
- HashMap
- kotlin
- asynccustomautoconfiguration
- list
- java list
- wire type
- aws secretmanager
- traceasynccustomautoconfiguration
- EnableWebMvc
- awssecretsmanagerpropertysources
- Spring JPA
- grpc
- CompletableFuture
- SpringMVC
- traceId
- Sleuth
- DeferredImportSelector
- spring
- spring MVC
- java.util.list
- java
- map
- jpa
- ResponseBody
- micrometer tracing
Archives
- Today
- Total
목록PriorityQueue (1)
du.study기록공간

최근 알고리즘 문제를 한개씩 풀다보면 풀다보면 자주 최대 힙, 최소 힙을 구현하여 사용해야 되는 경우가 생깁니다. (예를 들면 위상정렬, 최대값 뽑아내기 등) 자바에서는 현재 PriorityQueue를 이용하여 최대 힙, 최소 힙을 간단하게 사용할 수 있도록 제공해주고 있습니다. 다음은 최대 힙, 최소 힙에 대한 간단한 예시입니다. public void init() throws IOException{ PriorityQueue minHeap = new PriorityQueue(); System.out.println("최소 힙"); runHeapTest(minHeap); PriorityQueue maxHeap = new PriorityQueue(Collections.reverseOrder()); System..
자바
2019. 11. 10. 17:13