Documentation
¶
Index ¶
- type Element
- type List
- func (l *List[T]) Back() *Element[T]
- func (l *List[T]) Filter(fn func(T) bool) *List[T]
- func (l *List[T]) Find(fn func(T) bool) *Element[T]
- func (l *List[T]) Front() *Element[T]
- func (l *List[T]) InsertAfter(e *Element[T], v T)
- func (l *List[T]) InsertBefore(e *Element[T], v T)
- func (l *List[T]) Map(fn func(T) T)
- func (l *List[T]) MapBy(fn func(*T))
- func (l *List[T]) PopBack() *Element[T]
- func (l *List[T]) PopFront() *Element[T]
- func (l *List[T]) PushBack(v T)
- func (l *List[T]) PushFront(v T)
- func (l *List[T]) Remove(e *Element[T]) T
- func (l *List[T]) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element[T any] struct { Value T // contains filtered or unexported fields }
Element is an element of a linked list
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
List represents a doubly linked list. The zero value for List is an empty list ready to use
func (*List[T]) Filter ¶
Filter returns all the elements from the collection which satisfies the conditional logic of callback function
func (*List[T]) InsertAfter ¶
func (*List[T]) InsertBefore ¶
func (*List[T]) PushBack ¶
func (l *List[T]) PushBack(v T)
PushBack inserts a new element e with value v at the back of list l
func (*List[T]) PushFront ¶
func (l *List[T]) PushFront(v T)
PushFront inserts a new element e with value v at the front of list l
Click to show internal directories.
Click to hide internal directories.