test: add unit test for MaxHeap

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

No files matched your search

+1 -1
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