min Heap Of
Creates a new min-heap containing the given values.
Example:
val heap = minHeapOf(3, 2, 1)
heap.next() // 1
heap.next() // 2
heap.next() // 3Content copied to clipboard
Return
A new Heap instance containing the given values.
Author
Elizabeth Paige Harper - https://github.com/foxcapades
Since
0.1.0
Parameters
values
Values to insert into the created Heap.
Creates a new min-heap containing the given values.
Example:
val items = listOf(3, 2, 1)
val heap = minHeapOf(items)
heap.next() // 1
heap.next() // 2
heap.next() // 3Content copied to clipboard
Return
A new Heap instance containing the given values.
Author
Elizabeth Paige Harper - https://github.com/foxcapades
Since
0.1.0
Parameters
values
Values to insert into the created Heap.