fucking-algorithm icon indicating copy to clipboard operation
fucking-algorithm copied to clipboard

[fix][golang] merge-k-sorted-lists

Open mario-huang opened this issue 1 year ago • 0 comments

  • Define the pq variable as a pointer to simplify the syntax and make it easier for the reader to understand.
  • Replace interface{} with any, although they are equivalent, using any keeps the code consistent with the go's tool generate interface stubs.
  • Simplify the pop node expression for better understanding.
  • Rename Queue to PriorityQueue to avoid conceptual confusion. Queue is commonly used to represent a first-in-first-out (FIFO) queue, while PriorityQueue is commonly used to represent a heap.

我修改的是如下题目的 golang 解法: https://leetcode.com/problems/merge-k-sorted-lists

通过截图如下: Screenshot 2024-04-06 at 12 02 32 PM

mario-huang avatar Apr 06 '24 04:04 mario-huang