Documentation
¶
Overview ¶
Copyright (c) 2024 Thomas Mikalsen. Subject to the MIT License
Copyright (c) 2024 Thomas Mikalsen. Subject to the MIT License
Copyright (c) 2024 Thomas Mikalsen. Subject to the MIT License
Copyright (c) 2024 Thomas Mikalsen. Subject to the MIT License
Copyright (c) 2024 Thomas Mikalsen. Subject to the MIT License
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Nothing = struct{}{}
Nothing is the zero value of the Unit type
Functions ¶
This section is empty.
Types ¶
type Compare ¶
Compare is a function used to compare items during a search
-1 if a is less than b, 0 if a equals b, +1 if a is greater than b.
type Map ¶
type Map[K cmp.Ordered, V any] interface { Size() (size int) Get(key K) (val V, found bool) MustGet(key K) (val V) Put(key K, val V) Delete(key K) (deleted bool) }
Map is the interface to an associative container of key-value pairs with unique keys.
type Ordered ¶
type Ordered[K cmp.Ordered, V any] interface { Size() (size int) // Min returns the smallest key in the container, or false if the container is empty Min() (minKey K, ok bool) // Max returns the largest key in the container, or false if the container is empty Max() (maxKey K, ok bool) // VisitInOrder visits all key,value pairs in order VisitInOrder(v Visitor[K, V]) }
Ordered is the interface to a container of key-value pairs sorted by key
type Queue ¶
type Queue[T any] interface { Size() (len int) Enqueue(val T) Head() (head T, ok bool) MustHead() (head T) Dequeue() (head T, ok bool) MustDequeue() (head T) }
Queue is the interface to a first-in/first-out container of items.
Click to show internal directories.
Click to hide internal directories.