Documentation ¶ Index ¶ type MaxHeap func (h MaxHeap) Len() int func (h MaxHeap) Less(i, j int) bool func (h *MaxHeap) Pop() interface{} func (h *MaxHeap) Push(x interface{}) func (h MaxHeap) Swap(i, j int) type MinHeap func (h MinHeap) Len() int func (h MinHeap) Less(i, j int) bool func (h *MinHeap) Pop() interface{} func (h *MinHeap) Push(x interface{}) func (h MinHeap) Swap(i, j int) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type MaxHeap ¶ type MaxHeap []int 声明一个整数切片类型作为堆元素 func (MaxHeap) Len ¶ func (h MaxHeap) Len() int 实现 heap.Interface 接口的方法:Len、Less、Swap func (MaxHeap) Less ¶ func (h MaxHeap) Less(i, j int) bool func (*MaxHeap) Pop ¶ func (h *MaxHeap) Pop() interface{} func (*MaxHeap) Push ¶ func (h *MaxHeap) Push(x interface{}) 实现 heap.Interface 接口的方法:Push、Pop func (MaxHeap) Swap ¶ func (h MaxHeap) Swap(i, j int) type MinHeap ¶ type MinHeap []int 声明一个整数切片类型作为堆元素 func (MinHeap) Len ¶ func (h MinHeap) Len() int 实现 heap.Interface 接口的方法:Len、Less、Swap func (MinHeap) Less ¶ func (h MinHeap) Less(i, j int) bool func (*MinHeap) Pop ¶ func (h *MinHeap) Pop() interface{} func (*MinHeap) Push ¶ func (h *MinHeap) Push(x interface{}) 实现 heap.Interface 接口的方法:Push、Pop func (MinHeap) Swap ¶ func (h MinHeap) Swap(i, j int) Source Files ¶ View all Source files max.gomin.go Click to show internal directories. Click to hide internal directories.