Documentation
¶
Index ¶
- func Append[T any](sl []T, elements ...T) []T
- func Clone[T any](sl []T) []T
- func Eq[T comparable](left, right []T) bool
- func Find[T any](sl []T, predicate func(v T) bool) (v T, found bool)
- func FindLast[T any](sl []T, predicate func(v T) bool) (v T, found bool)
- func Get[T any](sl []T, index uint) (v T, ok bool)
- func Has[T comparable](sl []T, target T) bool
- func Insert[T any](sl []T, index uint, ele T) []T
- func Position[T any](sl []T, predicate func(v T) bool) int
- func PositionLast[T any](sl []T, predicate func(v T) bool) int
- func Prepend[T any](sl []T, elements ...T) []T
- type Deque
- func (d *Deque[T]) Append(elements ...T)
- func (d *Deque[T]) Clone() Deque[T]
- func (d *Deque[T]) Get(index uint) (v T, ok bool)
- func (d *Deque[T]) Insert(index uint, ele T)
- func (d *Deque[T]) Len() int
- func (d *Deque[T]) Pop() (v T, popped bool)
- func (d *Deque[T]) PopBack() (v T, popped bool)
- func (d *Deque[T]) PopFront() (v T, popped bool)
- func (d *Deque[T]) Prepend(elements ...T)
- func (d *Deque[T]) Push(v T)
- func (d *Deque[T]) PushBack(v T)
- func (d *Deque[T]) PushFront(v T)
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Eq ¶ added in v0.2.0
func Eq[T comparable](left, right []T) bool
func Has ¶ added in v0.0.3
func Has[T comparable](sl []T, target T) bool
func PositionLast ¶ added in v0.0.7
Types ¶
type Deque ¶
type Deque[T any] []T
Doubly ended queue.
func (*Deque[T]) PopBack ¶
PopBack removes an element from tail of underlying slice, and then returns removed value. If slice is empty, returns zero of T and false.
func (*Deque[T]) PopFront ¶
PopFront removes an element from head of underlying slice, and then returns removed value. If slice is empty, returns zero of T and false.
type Queue ¶
type Queue[T any] []T
FIFO queue.
Click to show internal directories.
Click to hide internal directories.