Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparable ¶
type Comparable[T any] = ekit.Comparator[T]
type PriorityQueue ¶
type PriorityQueue[T any] struct { // contains filtered or unexported fields }
func NewPriorityQueue ¶
func NewPriorityQueue[T any](cap int, cmp Comparable[T]) *PriorityQueue[T]
NewPriorityQueue creates a new priority queue with the given capacity and comparator. cmp if a > b return -1 then 小顶堆
func (*PriorityQueue[T]) All ¶
func (q *PriorityQueue[T]) All() []T
All after call this method, the queue will be empty
func (*PriorityQueue[T]) Enqueue ¶
func (q *PriorityQueue[T]) Enqueue(v T)
type ZQueueItem ¶
Click to show internal directories.
Click to hide internal directories.