File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change 11
11
6 . 共筆: GitHub https://github.com/programmingbookclub/Leetcode-club
12
12
7 . 備註:
13
13
14
- 這次的主題 Heap 是 premium 限定,但是有活動可以解鎖。這次第一次先來瀏覽大學課程的相關知識。請大家在留言提供你預習/記憶中想到的關於 Heap 的知識。
14
+ 這次的主題 Heap 是 premium 限定,但是有活動可以解鎖,如果看不到的話請聯繫 Yu 。這次第一次先來瀏覽大學課程的相關知識。請大家在留言提供你預習/記憶中想到的關於 Heap 的知識。
15
15
16
16
17
17
---
27
27
* 🔓 MEDIUM 1167 Minimum Cost to Connect Sticks https://leetcode.com/problems/minimum-cost-to-connect-sticks
28
28
* MEDIUM 1642 Furthest Building You Can Reach https://leetcode.com/problems/furthest-building-you-can-reach
29
29
* HARD 295 Find Median from Data Stream https://leetcode.com/problems/find-median-from-data-stream
30
+
31
+
32
+
33
+ ```
34
+ by Louis
35
+ 我來試著憑記憶描述 Heap
36
+ Heap 是一種永遠維持著根節點為數值最小 (或最大) 的樹狀結構,
37
+ 因此每一次從 Heap 取出最小值的都只需要 O(1) 的執行時間,i.e. 取得根節點
38
+ 為了維持根節點的這個特性,每一次放入或取出新節點,都需要一些 Heap 特有的計算,來調整樹狀結構的順序,
39
+ 同時,Heap 的節點必須是可以比較大小的
40
+ ```
41
+ @sharonWU0505
42
+ ```
43
+ Heap 是一種特殊的 binary tree (complete or nearly complete),它是 Priority Queue 的其中一種資料結構
44
+ 有分 Max Heap 和 Min Heap
45
+ Max Heap: 每個節點的值不小於子節點的值
46
+ Min Heap: 每個節點的值不大於子節點的值
47
+ 時間複雜度
48
+ 插入節點:O(log N)
49
+ 刪除節點:O(log N)
50
+ 取得最大/最小值:O(log N)
51
+ ```
52
+
53
+ @nghuiqin
54
+ 過去的手寫筆記
55
+ ![ ] ( https://i.imgur.com/PnMlt3t.jpg )
56
+ ![ ] ( https://i.imgur.com/icau83Q.jpg )
57
+
58
+
59
+
60
+
61
+ https://github.com/azl397985856/leetcode/blob/master/thinkings/heap-2.md
62
+
63
+ apps
64
+
65
+ know k way merge, but TooLongToRead https://en.wikipedia.org/wiki/K-way_merge_algorithm#Heap
You can’t perform that action at this time.
0 commit comments