MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / IsFull

Method IsFull

structure/circularqueue/circularqueuearray.go:73–75  ·  view source on GitHub ↗

IsFull checks if the queue is full.

()

Source from the content-addressed store, hash-verified

71
72// IsFull checks if the queue is full.
73func (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.
78func (cq *CircularQueue[T]) IsEmpty() bool {

Callers 2

EnqueueMethod · 0.95
TestCircularQueueFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestCircularQueueFunction · 0.36