mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
test: add unit test for MaxHeap
This commit is contained in:
1 parent
7ddeeb51e5
commit
0f61321d5b
2 files changed
+77
-1
No files matched your search
@@ -39,7 +39,7 @@ func (h *MaxHeap[T]) heapifyUp(i int) {
|
||||
|
||||
// Pop return the largest value, and remove it from the heap
|
||||
// if heap is empty, return zero value and fasle
|
||||
func (h *MaxHeap[T]) Pop(value T) (T, bool) {
|
||||
func (h *MaxHeap[T]) Pop() (T, bool) {
|
||||
var val T
|
||||
if h.Size() == 0 {
|
||||
return val, false
|
||||
|
||||
Reference in new issue
Block a user