Documentation
¶
Overview ¶
Package deque provides a double ended queue implemented using a ring buffer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deque ¶
type Deque[T any] struct { // contains filtered or unexported fields }
Deque is a double-ended queue. It has efficient (i.e. constant time) pop and push to both ends.
NOTE: It is currently implemented as a circular buffer but this detail should not be relied on.
func NewDequeWithCapacity ¶
NewDequeWithCapacity creates a new deque of Ts with the given initial capacity.
func (*Deque[T]) PopBack ¶
PopBack pops an item from the back of the deque, returning the default value and false if it is empty.
func (*Deque[T]) PopFront ¶
PopBack pops an item from the front of the deque, returning the default value and false if it is empty.
Click to show internal directories.
Click to hide internal directories.