Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMaxHeap ¶
func NewMaxHeap(nums []any) *maxHeap
refer: https://www.hello-algo.com/chapter_heap/build_heap/
构造方法,根据切片建堆,已有元素存储在切片中 * 时间复杂度: O(n)
Types ¶
Click to show internal directories.
Click to hide internal directories.