1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-15 02:02:27 +08:00

test: add unit test for MaxHeap

This commit is contained in:
dudaodong
2022-06-27 17:55:35 +08:00
parent 7ddeeb51e5
commit 0f61321d5b
2 changed files with 77 additions and 1 deletions

View File

@@ -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