Documentation
¶
Index ¶
- 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 Has[T comparable](sl []T, target T) bool
- func Position[T any](sl []T, predicate func(v T) bool) int
- func PositionLast[T any](sl []T, predicate func(v T) bool) int
- type Deque
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 queueu.
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.