Skip to content

Commit 08069c2

Browse files
committed
更新了一些东西
1 parent 4dbe8d3 commit 08069c2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

LeetCode.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
[324. 摆动排序 II](https://leetcode-cn.com/problems/wiggle-sort-ii/)(桶排序,先把元素放入桶里面,再分大小插空)
2828

29+
[539. 最小时间差](https://leetcode-cn.com/problems/minimum-time-difference/)(时间处理成分钟,并且算出下一天的偏移量,一起排序)
30+
2931

3032

3133
**下面三类排序重点掌握,能背下来最好**
@@ -151,8 +153,10 @@ func heapify(nums []int, curIdx, end int) {
151153
if j+1 <= end && nums[j] < nums[j+1] {
152154
j++ // 右子结点没越界,且左子结点没右子结点大,指向右子结点
153155
}
154-
if nums[curIdx] < nums[j] { // 比较子结点较大者与父结点
156+
if nums[curIdx] < nums[j] { // 比较子结点较大者与父结点谁更大
157+
// 子结点更大,那么需要与父结点交换位置
155158
nums[j], nums[curIdx] = nums[curIdx], nums[j]
159+
// z
156160
curIdx = j
157161
}else {
158162
break // 没有交换的话,就结束循环
@@ -428,10 +432,12 @@ private int[] getNext(String needle) {
428432

429433

430434

431-
##
435+
## (优先队列)
432436

433437
[295. 数据流的中位数](https://leetcode-cn.com/problems/find-median-from-data-stream/)
434438

439+
[373. 查找和最小的K对数字](https://leetcode-cn.com/problems/find-k-pairs-with-smallest-sums/)(双指针肯定是不行的,这个比较trick)
440+
435441

436442

437443

0 commit comments

Comments
 (0)