Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queue ¶
type Queue[T comparable.Equality] struct { // contains filtered or unexported fields }
Queue is a generic type buildt on top of a generic DLL
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 queue.
func (*Queue[T]) Peek ¶
Peek returns the top element of the queue or an error indicating that the queue is empty.
func (*Queue[T]) Pop ¶
Pop will remove the top element from the queue. An error is returned if the queue is empty.
Click to show internal directories.
Click to hide internal directories.