Heap heap implementation using generic.
| 7 | |
| 8 | // Heap heap implementation using generic. |
| 9 | type Heap[T any] struct { |
| 10 | heaps []T |
| 11 | lessFunc func(a, b T) bool |
| 12 | } |
| 13 | |
| 14 | // New gives a new heap object. |
| 15 | func New[T constraints.Ordered]() *Heap[T] { |
nothing calls this directly
no outgoing calls
no test coverage detected