- Heap을 사용해 풀이하는 문제 중 Top k 유형의 문제 - 풀이법 k best 요소를 찾는 문제. 가장 쉬운 해결법: 정렬 후 top k 요소 리턴하는 것. 시간복잡도: O(n log n) Heap을 사용하면 k < n일 때 O(n log k)로 해결 가능. 문제의 조건에 따라 heap에 요소를 넣은 뒤, k만큼 poll하고 답을 return. heap 처리는 최악의 경우 O(log k)이며 n만큼 반복했기 때문에 O(n log k) https://leetcode.com/problems/top-k-frequent-elements/ Top K Frequent Elements - LeetCode Can you solve this real interview question? Top K Frequent ..
https://leetcode.com/problems/find-median-from-data-stream/ Find Median from Data Stream - LeetCode Can you solve this real interview question? Find Median from Data Stream - The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values. * For exam leetcode.com min heap, max heap 두 개를 한번에 ..
https://leetcode.com/problems/minimum-operations-to-halve-array-sum/ Minimum Operations to Halve Array Sum - LeetCode Can you solve this real interview question? Minimum Operations to Halve Array Sum - You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Note that you may choose leetcode.com - 문제 You ar..
- Total
- Today
- Yesterday
- 크루스칼 알고리즘 자바
- Kruskal Algorithm Java
- ADsP 후기
- 데이터분석 준전문가
- Kruskal Algorithm
- 최소신장트리
- ADsP
- java
- 자격증
- R
- MST
- 크루스칼
- kruskal
- Algorithm
- 크루스칼 알고리즘
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |