Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNilRoot ErrNilRoot = errors.New("nil root node") // ErrNotFound ErrNotFound = errors.New("key not found") )
Functions ¶
This section is empty.
Types ¶
type DNode ¶
type DNode[K comparable, T any] struct { // contains filtered or unexported fields }
DNode
type DoubleLinkedList ¶
type DoubleLinkedList[K comparable, T any] struct { // contains filtered or unexported fields }
DoubleLinkedList
func (*DoubleLinkedList[K, T]) Insert ¶
func (dll *DoubleLinkedList[K, T]) Insert(key K, payload T) *DNode[K, T]
Insert
func (*DoubleLinkedList[K, T]) Search ¶
func (dll *DoubleLinkedList[K, T]) Search(key K) (T, error)
Search
type Iterator ¶
type Iterator[K comparable, T any] struct { // contains filtered or unexported fields }
Iterator
type LinkedList ¶
type LinkedList[K comparable, T any] struct { // contains filtered or unexported fields }
LinkedList generic linked list with comparable types
func (*LinkedList[K, T]) Insert ¶
func (ll *LinkedList[K, T]) Insert(key K, payload T) *Node[K, T]
Insert new node into list
func (*LinkedList[K, T]) Search ¶
func (ll *LinkedList[K, T]) Search(key K) (any, error)
Search list for key and return payload
func (*LinkedList[K, T]) Size ¶
func (ll *LinkedList[K, T]) Size() uintptr
Size returns size of list
type Node ¶
type Node[K comparable, T any] struct { Key K Payload T // contains filtered or unexported fields }
Node
Click to show internal directories.
Click to hide internal directories.