Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkedList ¶
type LinkedList[T constraints.Ordered] struct { // contains filtered or unexported fields }
LinkedList represents a singly linked list with nodes with values of type T.
func New ¶
func New[T constraints.Ordered]() *LinkedList[T]
New creates a new, empty singly linked list with nodes with values of type T.
func (*LinkedList[T]) Append ¶
func (ll *LinkedList[T]) Append(value T)
Append adds a new element at the end of the list.
func (*LinkedList[T]) Contains ¶
func (ll *LinkedList[T]) Contains(value T) bool
Contains returns true if the list contains the given value, false otherwise.
func (*LinkedList[T]) Delete ¶
func (ll *LinkedList[T]) Delete(value T)
Delete deletes an element from the list.
func (*LinkedList[T]) Length ¶
func (ll *LinkedList[T]) Length() int
Length returns the length of the list.
func (*LinkedList[T]) Prepend ¶
func (ll *LinkedList[T]) Prepend(value T)
Prepend adds a new element at the beginning of the list.
Click to show internal directories.
Click to hide internal directories.