Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayQueue ¶
type ArrayQueue[T any] struct { // contains filtered or unexported fields }
func NewArrayQueue ¶
func NewArrayQueue[T any](elems []T) *ArrayQueue[T]
NewArrayQueue returns a new queue with the provided elements.
func (*ArrayQueue[T]) Dequeue ¶
func (a *ArrayQueue[T]) Dequeue(count int32) ([]T, error)
func (*ArrayQueue[T]) Enqueue ¶
func (a *ArrayQueue[T]) Enqueue(elems []T) error
func (*ArrayQueue[T]) Len ¶
func (a *ArrayQueue[T]) Len() int32
func (*ArrayQueue[T]) Pop ¶
func (a *ArrayQueue[T]) Pop() (T, error)
func (*ArrayQueue[T]) Push ¶
func (a *ArrayQueue[T]) Push(item T) error
type LinkedListQueue ¶
type LinkedListQueue[T any] struct { // contains filtered or unexported fields }
func NewLinkedListQueue ¶
func NewLinkedListQueue[T any](elems []T) *LinkedListQueue[T]
NewLinkedListQueue returns a new queue with the provided elements.
func (*LinkedListQueue[T]) Dequeue ¶
func (q *LinkedListQueue[T]) Dequeue(count int32) ([]T, error)
Dequeue returns the first elements specified by the count param. If count is greater than the number of elements in the queue, all elements are returned.
func (*LinkedListQueue[T]) Enqueue ¶
func (q *LinkedListQueue[T]) Enqueue(elems []T) error
Enqueue adds the provided elements to the queue.
func (*LinkedListQueue[T]) Len ¶
func (q *LinkedListQueue[T]) Len() int32
Len returns the number of elements in the queue.
func (*LinkedListQueue[T]) Pop ¶
func (q *LinkedListQueue[T]) Pop() (T, error)
Pop removes and returns the first element in the queue.
func (*LinkedListQueue[T]) Push ¶
func (q *LinkedListQueue[T]) Push(e T) error
Push adds the provided element to the queue.
Click to show internal directories.
Click to hide internal directories.