heap_sort

package module
v0.0.0-...-71312b2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 1 Imported by: 0

README

heap_sort

Stupid heap sort

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sort

func Sort(input Iterable, k int) []interface{}

Sort Return [k]interface top elements(𝑛 log𝑘)

Types

type Iterable

type Iterable interface {
	Next() (Ranked, bool)
}

type Queue

type Queue []Ranked

func (Queue) Len

func (pq Queue) Len() int

func (Queue) Less

func (pq Queue) Less(i, j int) bool

func (*Queue) Pop

func (pq *Queue) Pop() interface{}

func (*Queue) Push

func (pq *Queue) Push(x interface{})

func (Queue) Swap

func (pq Queue) Swap(i, j int)

type Ranked

type Ranked interface {
	Rank() int
}

Jump to

Keyboard shortcuts

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