mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-25 01:16:31 +08:00
Fix Go comment and link
This commit is contained in:
parent
9ab4b0b15c
commit
1777a16865
4 changed files with 5 additions and 4 deletions
|
@ -30,6 +30,7 @@ func (h *minHeap) Top() any {
|
||||||
return (*h)[0]
|
return (*h)[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 基于堆查找数组中最大的 k 个元素 */
|
||||||
func topKHeap(nums []int, k int) *minHeap {
|
func topKHeap(nums []int, k int) *minHeap {
|
||||||
h := &minHeap{}
|
h := &minHeap{}
|
||||||
heap.Init(h)
|
heap.Init(h)
|
||||||
|
|
|
@ -256,7 +256,7 @@ $$
|
||||||
=== "Go"
|
=== "Go"
|
||||||
|
|
||||||
```go title="climbing_stairs_dfs_mem.go"
|
```go title="climbing_stairs_dfs_mem.go"
|
||||||
[class]{}-[func]{dfs}
|
[class]{}-[func]{dfsMem}
|
||||||
|
|
||||||
[class]{}-[func]{climbingStairsDFSMem}
|
[class]{}-[func]{climbingStairsDFSMem}
|
||||||
```
|
```
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
=== "Go"
|
=== "Go"
|
||||||
|
|
||||||
```go title="fractional_knapsack.go"
|
```go title="fractional_knapsack.go"
|
||||||
[class]{}-[func]{II}
|
[class]{Item}-[func]{}
|
||||||
|
|
||||||
[class]{}-[func]{fractionalKnapsack}
|
[class]{}-[func]{fractionalKnapsack}
|
||||||
```
|
```
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
=== "Go"
|
=== "Go"
|
||||||
|
|
||||||
```go title="top_k.go"
|
```go title="top_k.go"
|
||||||
[class]{maxHeap}-[func]{topKHeap}
|
[class]{}-[func]{topKHeap}
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "JavaScript"
|
=== "JavaScript"
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
=== "C"
|
=== "C"
|
||||||
|
|
||||||
```c title="top_k.c"
|
```c title="top_k.c"
|
||||||
[class]{maxHeap}-[func]{topKHeap}
|
[class]{}-[func]{topKHeap}
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "C#"
|
=== "C#"
|
||||||
|
|
Loading…
Reference in a new issue