Documentation
¶
Index ¶
- type Elem
- type List
- func (l *List[T]) InsertAfter(v T, at *Elem[T]) *Elem[T]
- func (l *List[T]) InsertBefore(v T, at *Elem[T]) *Elem[T]
- func (l *List[T]) InsertElemAfter(elem *Elem[T], at *Elem[T])
- func (l *List[T]) InsertElemBefore(elem *Elem[T], at *Elem[T])
- func (l *List[T]) Len() int
- func (l *List[T]) PushBack(v T) *Elem[T]
- func (l *List[T]) PushElemBack(elem *Elem[T])
- func (l *List[T]) PushElemFront(elem *Elem[T])
- func (l *List[T]) PushFront(v T) *Elem[T]
- func (l *List[T]) Range(fn func(*Elem[T]))
- func (l *List[T]) RangeReverse(fn func(*Elem[T]))
- func (l *List[T]) Remove(elem *Elem[T])
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
List implements a doubly-linked list, where: - Head = index 0 (i.e. the front) - Tail = index n-1 (i.e. the back)
func (*List[T]) InsertAfter ¶
InsertAfter adds 'v' into the list after 'at'.
func (*List[T]) InsertBefore ¶
InsertBefore adds 'v' into the list before 'at'.
func (*List[T]) InsertElemAfter ¶
InsertElemAfter adds 'elem' into the list after 'at' (i.e. at.Next = elem).
func (*List[T]) InsertElemBefore ¶
InsertElemBefore adds 'elem' into the list before 'at' (i.e. at.Prev = elem).
func (*List[T]) PushElemBack ¶
PushBackNode adds 'elem' to the back of the list.
func (*List[T]) PushElemFront ¶
PushFrontNode adds 'elem' to the front of the list.
func (*List[T]) RangeReverse ¶
RangeReverse calls 'fn' on every element from tail backward in list.
Click to show internal directories.
Click to hide internal directories.