1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-03-01 00:35:28 +08:00

feat: add IsFull function for ArrayQueue

This commit is contained in:
dudaodong
2022-06-05 16:43:15 +08:00
parent 2ef9b56d22
commit dbca2f6be4
2 changed files with 16 additions and 0 deletions
+5
View File
@@ -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]