heap

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL