mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-15 18:22:27 +08:00
feat: add PriorityQueue
This commit is contained in:
@@ -2,8 +2,7 @@ package datastructure
|
|||||||
|
|
||||||
import "github.com/duke-git/lancet/v2/lancetconstraints"
|
import "github.com/duke-git/lancet/v2/lancetconstraints"
|
||||||
|
|
||||||
// PriorityQueue is a implemented by binary heap tree
|
// PriorityQueue is a priority queue implemented by binary heap tree
|
||||||
// which are referred to as the left child and the right child.
|
|
||||||
// type T should implements Compare function in lancetconstraints.Comparator interface.
|
// type T should implements Compare function in lancetconstraints.Comparator interface.
|
||||||
type PriorityQueue[T any] struct {
|
type PriorityQueue[T any] struct {
|
||||||
items []T
|
items []T
|
||||||
|
|||||||
Reference in New Issue
Block a user