binaryheap

package
v0.0.0-...-5cc1d31 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 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 BinaryHeap

type BinaryHeap struct {
	// contains filtered or unexported fields
}

BinaryHeap 二叉堆

func New

func New(values []Item) *BinaryHeap

New 构造二叉堆

func (*BinaryHeap) Init

func (heap *BinaryHeap) Init()

Init 初始化堆结构

func (*BinaryHeap) Pop

func (heap *BinaryHeap) Pop() Item

Pop 弹出堆顶数据

func (*BinaryHeap) Push

func (heap *BinaryHeap) Push(value Item)

Push 插入新数据

type Item

type Item interface {
	Less(Item) bool
}

Item 二叉堆的数据需要实现的接口

Jump to

Keyboard shortcuts

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