From 1777a168659d54acf619cc4e6bc03180db45e755 Mon Sep 17 00:00:00 2001 From: krahets Date: Mon, 24 Jul 2023 13:11:00 +0800 Subject: [PATCH] Fix Go comment and link --- codes/go/chapter_heap/top_k.go | 1 + .../intro_to_dynamic_programming.md | 2 +- docs/chapter_greedy/fractional_knapsack_problem.md | 2 +- docs/chapter_heap/top_k.md | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/codes/go/chapter_heap/top_k.go b/codes/go/chapter_heap/top_k.go index a446544a9..ae8c7fafd 100644 --- a/codes/go/chapter_heap/top_k.go +++ b/codes/go/chapter_heap/top_k.go @@ -30,6 +30,7 @@ func (h *minHeap) Top() any { return (*h)[0] } +/* 基于堆查找数组中最大的 k 个元素 */ func topKHeap(nums []int, k int) *minHeap { h := &minHeap{} heap.Init(h) diff --git a/docs/chapter_dynamic_programming/intro_to_dynamic_programming.md b/docs/chapter_dynamic_programming/intro_to_dynamic_programming.md index 9a2a60970..fb2efd0f1 100644 --- a/docs/chapter_dynamic_programming/intro_to_dynamic_programming.md +++ b/docs/chapter_dynamic_programming/intro_to_dynamic_programming.md @@ -256,7 +256,7 @@ $$ === "Go" ```go title="climbing_stairs_dfs_mem.go" - [class]{}-[func]{dfs} + [class]{}-[func]{dfsMem} [class]{}-[func]{climbingStairsDFSMem} ``` diff --git a/docs/chapter_greedy/fractional_knapsack_problem.md b/docs/chapter_greedy/fractional_knapsack_problem.md index 12d33cb8a..778e09ad9 100644 --- a/docs/chapter_greedy/fractional_knapsack_problem.md +++ b/docs/chapter_greedy/fractional_knapsack_problem.md @@ -58,7 +58,7 @@ === "Go" ```go title="fractional_knapsack.go" - [class]{}-[func]{II} + [class]{Item}-[func]{} [class]{}-[func]{fractionalKnapsack} ``` diff --git a/docs/chapter_heap/top_k.md b/docs/chapter_heap/top_k.md index b01a214f2..0462d55e9 100644 --- a/docs/chapter_heap/top_k.md +++ b/docs/chapter_heap/top_k.md @@ -87,7 +87,7 @@ === "Go" ```go title="top_k.go" - [class]{maxHeap}-[func]{topKHeap} + [class]{}-[func]{topKHeap} ``` === "JavaScript" @@ -105,7 +105,7 @@ === "C" ```c title="top_k.c" - [class]{maxHeap}-[func]{topKHeap} + [class]{}-[func]{topKHeap} ``` === "C#"