Skip to content

Commit 939ce3f

Browse files
authored
Merge pull request #35 from programmingbookclub/42-2022-0503-heap-5th
Create 42 2022 0503 heap 5th.md
2 parents b48f64a + 4691c87 commit 939ce3f

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

紀錄/42 2022 0503 heap 5th.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# LeetCode 讀書會第 42 次聚會 2022/05/03
2+
3+
## leetcode 讀書會通知
4+
5+
1. 項目: 第 42 次聚會
6+
2. 目的: 線上一起寫題目, 由有想法的人帶領, 先解題, 再看該題有趣的解法
7+
3. 時間: 05/03 (二) 20:00 ~ 21:00
8+
4. 地點: google meet 線上 (前 10 分鐘預備鏈接)
9+
5. 解題項目: [Heap](https://leetcode.com/explore/featured/card/heap/643/heap/)
10+
6. 共筆: GitHub https://github.com/programmingbookclub/Leetcode-club
11+
7. 備註: 這次會看 378, 是一題 MEDIUM 的題目
12+
13+
14+
15+
---
16+
17+
* [done] MEDIUM 215 Kth Largest Element in an Array https://leetcode.com/problems/kth-largest-element-in-an-array
18+
* [done] MEDIUM 347 Top K Frequent Elements https://leetcode.com/problems/top-k-frequent-elements
19+
* [done] EASY 703 Kth Largest Element in a Stream https://leetcode.com/problems/kth-largest-element-in-a-stream
20+
* [done] EASY 1046 Last Stone Weight https://leetcode.com/problems/last-stone-weight
21+
* [done] EASY 1337 The K Weakest Rows in a Matrix https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix
22+
* MEDIUM 378 Kth Smallest Element in a Sorted Matrix https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix
23+
* 🔓 MEDIUM 253 Meeting Rooms II https://leetcode.com/problems/meeting-rooms-ii
24+
* MEDIUM 973 K Closest Points to Origin https://leetcode.com/problems/k-closest-points-to-origin
25+
* 🔓 MEDIUM 1167 Minimum Cost to Connect Sticks https://leetcode.com/problems/minimum-cost-to-connect-sticks
26+
* MEDIUM 1642 Furthest Building You Can Reach https://leetcode.com/problems/furthest-building-you-can-reach
27+
* HARD 295 Find Median from Data Stream https://leetcode.com/problems/find-median-from-data-stream
28+
29+
---
30+
31+
32+
Y.J. LEE下午8:02
33+
Helli
34+
Hello XD
35+
Y.J. LEE下午8:30
36+
Tip: time/space analysis 可以把avg case / best case / worst case分開討論
37+
Y.J. LEE下午8:54
38+
10個剛好可以
39+
8就有可能出現在mat[1][-1] 最後一個
40+
Y.J. LEE下午8:55
41+
great test case
42+
Louis Su下午8:56
43+
🙏
44+
Y.J. LEE下午9:05
45+
很優啊 實戰給出binary search應該就是optimal solution了
46+
Y.J. LEE下午9:09
47+
👍
48+
Y.J. LEE下午9:11
49+
yes, #1631 can use heap
50+
Lester下午9:13
51+
有事先走唷,謝謝大家。
52+
Y.J. LEE下午9:13
53+
881
54+
Y.J. LEE下午9:15
55+
剛那題時間複雜度比較複雜
56+
每一行還可以再binary search一次
57+
我當時是寫 time O(nlogn * log(S)), where S=span of min to max
58+
但是也不確定對不對
59+
Y.J. LEE下午9:18
60+
嗯 前面 nlogn就是 猜了那個數以後 數一數看看比他小的有幾個
61+
Louis Su下午9:18
62+
https://github.com/louis222220/leetcode-practice/pull/2/files
63+
Y.J. LEE下午9:24
64+
nice implementation
65+
看了一下 Java 的實作
66+
他是用 generic iterator
67+
Y.J. LEE下午9:26
68+
https://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/util/PriorityQueue.java

0 commit comments

Comments
 (0)