Documentation ¶
Index ¶
- type LinkedList
- func (it *LinkedList[T]) Clear()
- func (it *LinkedList[T]) First() (T, bool)
- func (it *LinkedList[T]) ForEach(fn func(i int, item T))
- func (it *LinkedList[T]) Get(index int) (T, bool)
- func (it *LinkedList[T]) Last() (T, bool)
- func (it *LinkedList[T]) Len() int
- func (it *LinkedList[T]) Pop() (T, bool)
- func (it *LinkedList[T]) Push(item T) int
- func (it *LinkedList[T]) Remove(index int) int
- func (it *LinkedList[T]) Shift() (T, bool)
- func (it *LinkedList[T]) Unshift(item T) int
- type LinkedNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkedList ¶
type LinkedList[T any] struct { // contains filtered or unexported fields }
func (*LinkedList[T]) Clear ¶
func (it *LinkedList[T]) Clear()
func (*LinkedList[T]) First ¶
func (it *LinkedList[T]) First() (T, bool)
func (*LinkedList[T]) ForEach ¶
func (it *LinkedList[T]) ForEach(fn func(i int, item T))
func (*LinkedList[T]) Get ¶
func (it *LinkedList[T]) Get(index int) (T, bool)
func (*LinkedList[T]) Last ¶
func (it *LinkedList[T]) Last() (T, bool)
func (*LinkedList[T]) Len ¶
func (it *LinkedList[T]) Len() int
func (*LinkedList[T]) Pop ¶
func (it *LinkedList[T]) Pop() (T, bool)
func (*LinkedList[T]) Push ¶
func (it *LinkedList[T]) Push(item T) int
func (*LinkedList[T]) Remove ¶
func (it *LinkedList[T]) Remove(index int) int
func (*LinkedList[T]) Shift ¶
func (it *LinkedList[T]) Shift() (T, bool)
func (*LinkedList[T]) Unshift ¶
func (it *LinkedList[T]) Unshift(item T) int
type LinkedNode ¶
type LinkedNode[T any] struct { Item T Pre *LinkedNode[T] Next *LinkedNode[T] }
func (*LinkedNode[T]) Append ¶
func (it *LinkedNode[T]) Append(item T) *LinkedNode[T]
func (*LinkedNode[T]) Insert ¶
func (it *LinkedNode[T]) Insert(node *LinkedNode[T])
func (*LinkedNode[T]) InsertAfter ¶
func (it *LinkedNode[T]) InsertAfter(node *LinkedNode[T])
func (*LinkedNode[T]) MoveTo ¶
func (it *LinkedNode[T]) MoveTo(ref *LinkedNode[T])
func (*LinkedNode[T]) Remove ¶
func (it *LinkedNode[T]) Remove()
Click to show internal directories.
Click to hide internal directories.