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

Struct CircularQueue

structure/circularqueue/circularqueuearray.go:20–25  ·  view source on GitHub ↗

CircularQueue represents a circular queue data structure.

Source from the content-addressed store, hash-verified

18
19// CircularQueue represents a circular queue data structure.
20type CircularQueue[T any] struct {
21 items []T
22 front int
23 rear int
24 size int
25}
26
27// NewCircularQueue creates a new CircularQueue with the given size.
28// Returns an error if the size is less than or equal to 0.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected