Skip to content

Commit b48f64a

Browse files
authored
Merge pull request #33 from programmingbookclub/40-2022-0308-Heap-3nd
Create 40 2022 0308 Heap 3nd.md
2 parents 2333c40 + 167f5a7 commit b48f64a

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

紀錄/40 2022 0308 Heap 3nd.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
# LeetCode 讀書會第 40 次聚會 2022/03/08
3+
4+
## leetcode 讀書會通知
5+
6+
1. 項目: 第 40 次聚會
7+
2. 目的: 線上一起寫題目, 由有想法的人帶領, 先解題, 再看該題有趣的解法
8+
3. 時間: 03/08 (二) 20:00 ~ 21:00
9+
4. 地點: google meet 線上 (前 10 分鐘預備鏈接)
10+
5. 解題項目: [Heap](https://leetcode.com/explore/featured/card/heap/643/heap/)
11+
6. 共筆: GitHub https://github.com/programmingbookclub/Leetcode-club
12+
7. 備註:
13+
14+
這次會強調嘗試 Binary Heap 從無到有的實作,從 347 開始。
15+
16+
17+
---
18+
19+
* [done] MEDIUM 215 Kth Largest Element in an Array https://leetcode.com/problems/kth-largest-element-in-an-array
20+
* MEDIUM 347 Top K Frequent Elements https://leetcode.com/problems/top-k-frequent-elements
21+
* EASY 703 Kth Largest Element in a Stream https://leetcode.com/problems/kth-largest-element-in-a-stream
22+
* EASY 1046 Last Stone Weight https://leetcode.com/problems/last-stone-weight
23+
* EASY 1337 The K Weakest Rows in a Matrix https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix
24+
* MEDIUM 378 Kth Smallest Element in a Sorted Matrix https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix
25+
* 🔓 MEDIUM 253 Meeting Rooms II https://leetcode.com/problems/meeting-rooms-ii
26+
* MEDIUM 973 K Closest Points to Origin https://leetcode.com/problems/k-closest-points-to-origin
27+
* 🔓 MEDIUM 1167 Minimum Cost to Connect Sticks https://leetcode.com/problems/minimum-cost-to-connect-sticks
28+
* MEDIUM 1642 Furthest Building You Can Reach https://leetcode.com/problems/furthest-building-you-can-reach
29+
* 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)