Skip to content

Commit 167f5a7

Browse files
Update 紀錄/40 2022 0308 Heap 3nd.md
Co-authored-by: Louis <louis222220@gmail.com>
1 parent 678d42f commit 167f5a7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

紀錄/40 2022 0308 Heap 3nd.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,12 @@
2727
* 🔓 MEDIUM 1167 Minimum Cost to Connect Sticks https://leetcode.com/problems/minimum-cost-to-connect-sticks
2828
* MEDIUM 1642 Furthest Building You Can Reach https://leetcode.com/problems/furthest-building-you-can-reach
2929
* HARD 295 Find Median from Data Stream https://leetcode.com/problems/find-median-from-data-stream
30+
31+
---
32+
33+
- 從 Array 建立起 Heap 的時間複雜度
34+
- Foreach => O(N LogN)
35+
- Heapify => O(N)
36+
- No. 347. Top K Frequent Elements 解法
37+
- 算出每個數字的頻率後,把頻率表放進 heap
38+
- 使用 Bucket Sort

0 commit comments

Comments
 (0)