Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyQueue = errors.New("Empty Queue")
An error to indicate that the stack is empty
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T any] struct { // contains filtered or unexported fields }
Queue is a generic type buildt on top of a slice
func (*Queue[T]) Dequeue ¶
Dequeue remove and return an element from the queue (if there is one), else return an error.
func (*Queue[T]) Enqueue ¶
func (ns *Queue[T]) Enqueue(t T)
Enqueue is the same as Push. Enqueue will push new data of type [T any] onto the stack.
func (*Queue[T]) Peek ¶
Peek returns the top element of the stack or an error indicating that the stack is empty.
Click to show internal directories.
Click to hide internal directories.