Documentation ¶
Overview ¶
Example ¶
pq := New2[int, string](3) pq.Push(1, "1") pq.Push(9, "9") pq.Push(9, "9") pq.Push(7, "7") for pq.Size() > 0 { fmt.Print(pq.Pop()) } fmt.Println() pq.Push(100, "1") pq.Push(9, "9") pq.Push(9, "9") pq.Push(7, "7") pq.Push(0, "x") pq.Del("x") pq.Fix(1, "1") for pq.Size() > 0 { fmt.Print(pq.Pop()) }
Output: 1799 1799
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Elem ¶
type Elem[O constraints.Ordered, T any] struct { // contains filtered or unexported fields }
type Heap ¶
type Heap[O constraints.Ordered, T any] struct { // contains filtered or unexported fields }
type Heap2 ¶
type Heap2[P constraints.Ordered, V comparable] struct { Heap[P, V] }
func New2 ¶
func New2[P constraints.Ordered, V comparable](cap uint) *Heap2[P, V]
Click to show internal directories.
Click to hide internal directories.