mirror of
https://github.com/duke-git/lancet.git
synced 2025-10-05 15:36:52 +08:00
feat: add IsFull function for ArrayQueue
This commit is contained in:
@@ -43,6 +43,11 @@ func (q *ArrayQueue[T]) IsEmpty() bool {
|
||||
return q.size == 0
|
||||
}
|
||||
|
||||
// IsFull checks if queue is full or not
|
||||
func (q *ArrayQueue[T]) IsFull() bool {
|
||||
return q.size == q.capacity
|
||||
}
|
||||
|
||||
// Front return front value of queue
|
||||
func (q *ArrayQueue[T]) Front() T {
|
||||
return q.items[0]
|
||||
|
Reference in New Issue
Block a user