mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-04 23:22:42 +08:00
feat: add Size func for PriorityQueue
This commit is contained in:
@@ -29,6 +29,11 @@ func (q *PriorityQueue[T]) IsEmpty() bool {
|
||||
return q.size == 0
|
||||
}
|
||||
|
||||
// Size get number of items in the queue
|
||||
func (q *PriorityQueue[T]) Size() int {
|
||||
return q.size
|
||||
}
|
||||
|
||||
// IsFull checks if the queue capacity is full or not
|
||||
func (q *PriorityQueue[T]) IsFull() bool {
|
||||
return q.size == len(q.items)-1
|
||||
|
Reference in New Issue
Block a user