Documentation
¶
Index ¶
- type AdjacencyList
- type BinaryHeap
- type LinkedList
- func (l *LinkedList[T]) Append(value T)
- func (l *LinkedList[T]) Copy() *LinkedList[T]
- func (l *LinkedList[T]) ForEach(f func(T))
- func (l *LinkedList[T]) Len() int
- func (l *LinkedList[T]) Reverse()
- func (l *LinkedList[T]) ReversedCopy() *LinkedList[T]
- func (l *LinkedList[T]) Shift() (T, bool)
- func (l *LinkedList[T]) ToQueue() Queue[T]
- func (l *LinkedList[T]) ToStack() Stack[T]
- func (l *LinkedList[T]) Unshift(value T)
- type LinkedListNode
- type Queue
- type Stack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdjacencyList ¶
type AdjacencyList[T comparable, O constraints.Ordered] interface { AddEdge(n1, n2 T, weight O) AddUndirectedEdge(n1, n2 T, weight O) Edges(node T, fn func(node T, weight O)) Len() int }
func NewAdjacencyList ¶
func NewAdjacencyList[T comparable, O constraints.Ordered]() AdjacencyList[T, O]
type BinaryHeap ¶
BinaryHeap is a data structure that could speed up hifo calculations
func NewBinaryHeap ¶
func NewBinaryHeap[T any](compFn func(T, T) int) BinaryHeap[T]
type LinkedList ¶
type LinkedList[T any] struct { // contains filtered or unexported fields }
func (*LinkedList[T]) Append ¶
func (l *LinkedList[T]) Append(value T)
func (*LinkedList[T]) Copy ¶
func (l *LinkedList[T]) Copy() *LinkedList[T]
func (*LinkedList[T]) ForEach ¶
func (l *LinkedList[T]) ForEach(f func(T))
func (*LinkedList[T]) Len ¶
func (l *LinkedList[T]) Len() int
func (*LinkedList[T]) Reverse ¶
func (l *LinkedList[T]) Reverse()
func (*LinkedList[T]) ReversedCopy ¶
func (l *LinkedList[T]) ReversedCopy() *LinkedList[T]
func (*LinkedList[T]) Shift ¶
func (l *LinkedList[T]) Shift() (T, bool)
func (*LinkedList[T]) ToQueue ¶
func (l *LinkedList[T]) ToQueue() Queue[T]
func (*LinkedList[T]) ToStack ¶
func (l *LinkedList[T]) ToStack() Stack[T]
func (*LinkedList[T]) Unshift ¶
func (l *LinkedList[T]) Unshift(value T)
type LinkedListNode ¶
type LinkedListNode[T any] struct { Value T Next *LinkedListNode[T] }
type Queue ¶
Queue is a convenient data structure used for FIFO
func NewQueueFromSlice ¶
NewQueueFromSlice accepts a Slice and returns a Queue with the first item in the slice at the beginning of the queue
type Stack ¶
Stack is a convenient data structure used for LIFO
func NewStackFromSlice ¶
NewStackFromSlice accepts a Slice and returns a Stack with the first item in the slice at the top of the stack
Click to show internal directories.
Click to hide internal directories.