Documentation
¶
Index ¶
- type Element
- type List
- func (l *List[T]) Add(data T) *Element[T]
- func (l *List[T]) AddAt(index int, data T) error
- func (l *List[T]) AddFirst(data T) *Element[T]
- func (l *List[T]) Clear()
- func (l *List[T]) Clone() *List[T]
- func (l *List[T]) Delete(fn func(T) bool) bool
- func (l *List[T]) DeleteAt(index int) (T, error)
- func (l *List[T]) Entries() iter.Seq2[int, T]
- func (l *List[T]) Get(index int) (T, error)
- func (l *List[T]) Head() *Element[T]
- func (l *List[T]) MoveToFirst(e *Element[T])
- func (l *List[T]) MoveToLast(e *Element[T])
- func (l *List[T]) PeekFirst() (T, error)
- func (l *List[T]) PeekLast() (T, error)
- func (l *List[T]) RemoveFirst() (T, error)
- func (l *List[T]) RemoveLast() (T, error)
- func (l *List[T]) ReplaceAll(fn func(int, T) T)
- func (l *List[T]) Set(index int, data T) error
- func (l *List[T]) Size() int
- func (l *List[T]) Tail() *Element[T]
- func (l *List[T]) Values() iter.Seq[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List[T any] struct { // contains filtered or unexported fields }
func (*List[T]) MoveToFirst ¶
MoveToFirst moves element to the beginning (head) of this linked list, O(1)
func (*List[T]) MoveToLast ¶
MoveToLast moves element to the tail of the linked list, O(1)
func (*List[T]) PeekFirst ¶
PeekFirst checks the value of the first element (head) if it exists, O(1)
func (*List[T]) RemoveFirst ¶
RemoveFirst removes the first value at the head of the linked list, O(1)
func (*List[T]) RemoveLast ¶
RemoveLast removes the last value at the tail of the linked list, O(1)
func (*List[T]) ReplaceAll ¶
Click to show internal directories.
Click to hide internal directories.