IsFull checks if the queue is full.
()
| 71 | |
| 72 | // IsFull checks if the queue is full. |
| 73 | func (cq *CircularQueue[T]) IsFull() bool { |
| 74 | return (cq.front == 0 && cq.rear == cq.size-1) || cq.front == cq.rear+1 |
| 75 | } |
| 76 | |
| 77 | // IsEmpty checks if the queue is empty. |
| 78 | func (cq *CircularQueue[T]) IsEmpty() bool { |
no outgoing calls