Documentation
¶
Index ¶
- type LinkedList
- func (ll *LinkedList[T]) Append(val ...T)
- func (ll *LinkedList[T]) Clear()
- func (ll *LinkedList[T]) Delete(target *Node[T]) bool
- func (ll *LinkedList[T]) Find(val T) *Node[T]
- func (ll *LinkedList[T]) Head() *Node[T]
- func (ll *LinkedList[T]) InsertAfter(target *Node[T], val T) error
- func (ll *LinkedList[T]) IsEmpty() bool
- func (ll *LinkedList[T]) Len() int
- func (ll *LinkedList[T]) Present(val T) bool
- func (ll *LinkedList[T]) PushBack(val T)
- func (ll *LinkedList[T]) PushFront(val T)
- func (ll *LinkedList[T]) Tail() *Node[T]
- func (ll *LinkedList[T]) Values() []T
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkedList ¶
type LinkedList[T comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[T comparable]() *LinkedList[T]
func (*LinkedList[T]) Append ¶
func (ll *LinkedList[T]) Append(val ...T)
func (*LinkedList[T]) Clear ¶ added in v0.2.0
func (ll *LinkedList[T]) Clear()
func (*LinkedList[T]) Delete ¶
func (ll *LinkedList[T]) Delete(target *Node[T]) bool
func (*LinkedList[T]) Find ¶
func (ll *LinkedList[T]) Find(val T) *Node[T]
Find searches for the first node containing val. It returns nil if the value is not present in the list.
func (*LinkedList[T]) Head ¶
func (ll *LinkedList[T]) Head() *Node[T]
func (*LinkedList[T]) InsertAfter ¶
func (ll *LinkedList[T]) InsertAfter(target *Node[T], val T) error
func (*LinkedList[T]) IsEmpty ¶
func (ll *LinkedList[T]) IsEmpty() bool
func (*LinkedList[T]) Len ¶
func (ll *LinkedList[T]) Len() int
func (*LinkedList[T]) Present ¶ added in v0.2.2
func (ll *LinkedList[T]) Present(val T) bool
func (*LinkedList[T]) PushBack ¶
func (ll *LinkedList[T]) PushBack(val T)
func (*LinkedList[T]) PushFront ¶
func (ll *LinkedList[T]) PushFront(val T)
func (*LinkedList[T]) Tail ¶
func (ll *LinkedList[T]) Tail() *Node[T]
func (*LinkedList[T]) Values ¶
func (ll *LinkedList[T]) Values() []T
Click to show internal directories.
Click to hide internal directories.