package
Version:
v0.0.0-...-940ab64
Opens a new window with list of versions in this module.
Published: Jul 19, 2022
License: GPL-3.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type List[V any] struct {
Head, Tail *Node[V]
}
List is double linked list
New retruns a new an empty list
Len returns length of List
func (l *List[V]) PushHead(v V)
PushHead push value of element into the head of list
func (l *List[V]) PushHeadNode(n *Node[V])
PushHeadNode push element into the head of list
func (l *List[V]) PushTail(v V)
PushTail push value of element into the tail of list
func (l *List[V]) PushTailNode(n *Node[V])
PushTailNode push element into the tail of list
String returns a string with all the message of list,
you can print it out to know all about the list.
type Node[V any] struct {
Value V
Prev, Next *Node[V]
}
Node of list
func (n *Node[V]) Each(fn func(val V))
Each calls `fn` on each Node from n onward in the list
func (n *Node[V]) ReverseEach(fn func(val V))
ReverseEach calls `fn` on each Node from n backward in the list
Source Files
¶
Click to show internal directories.
Click to hide internal directories.