Documentation ¶
Index ¶
- type CHeap
- func (ch *CHeap[P, T]) ExtractMax()
- func (ch *CHeap[P, T]) GetMax()
- func (ch *CHeap[P, T]) GetNodes(content T) ([]*Node[P, T], error)
- func (ch *CHeap[P, T]) IncreasePriority(n *Node[P, T], newPriority P)
- func (ch *CHeap[P, T]) Insert(priority P, element T)
- func (ch *CHeap[P, T]) InsertNode(n *Node[P, T])
- func (ch *CHeap[P, T]) Merge(ch2 *CHeap[P, T])
- type DegreeArray
- type Heap
- type Node
- type Number
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CHeap ¶
type CHeap[P Number, T comparable] Heap[P, T]
A subtype of Heap where the content is comparable,
ie one node can have equal content to another
func (*CHeap[P, T]) ExtractMax ¶
func (ch *CHeap[P, T]) ExtractMax()
func (*CHeap[P, T]) GetNodes ¶
asynchronously queries every node to get the list of nodes that contain T
func (*CHeap[P, T]) IncreasePriority ¶
func (*CHeap[P, T]) InsertNode ¶
type DegreeArray ¶
A type of NodeList such that at index i lies a tree of degree i
type Heap ¶
func (*Heap[P, T]) ExtractMax ¶
func (h *Heap[P, T]) ExtractMax() (P, T)
Deletes the max, and returns it
func (*Heap[P, T]) IncreasePriority ¶
Increases the priority of a node If the node is would get a larger priority than its parent, then adds it as a new root
func (*Heap[P, T]) InsertNode ¶
InsertNodes and updates maximum
type Node ¶
A Node stores a value and a priority such that getting the minimal priority of a Heap is easy
type Number ¶
type Number interface { constraints.Integer | constraints.Float }
Click to show internal directories.
Click to hide internal directories.