Skip to content

holy-func/heap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

heap

go 1.18+ 简单易用的最大最小堆

example

c := 6
heap := MaxHeap(func(a, b int) bool {
    return a < b
},c)
heap.Init([]int{2333, 223, 123, 11, 21, 14})
for c > 0 {
    fmt.Println(heap.Pop())
    c--
}

output

2333
223
123
21
14
11

About

go 1.18+ 简单易用的最大最小堆

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages