refactor: Replace 'poll' with 'pop' in Heap (#416)

This commit is contained in:
Yudong Jin
2023-03-13 22:31:05 +08:00
committed by GitHub
parent 8aebbaad21
commit 28aacccf44
27 changed files with 91 additions and 152 deletions

View File

@ -18,7 +18,7 @@ public class heap
PrintUtil.printHeap(heap);
}
public void testPoll(PriorityQueue<int, int> heap)
public void testPop(PriorityQueue<int, int> heap)
{
int val = heap.Dequeue(); // 堆顶元素出堆
Console.WriteLine($"\n堆顶元素 {val} 出堆后\n");
@ -47,11 +47,11 @@ public class heap
/* 堆顶元素出堆 */
// 出堆元素会形成一个从大到小的序列
testPoll(maxHeap);
testPoll(maxHeap);
testPoll(maxHeap);
testPoll(maxHeap);
testPoll(maxHeap);
testPop(maxHeap);
testPop(maxHeap);
testPop(maxHeap);
testPop(maxHeap);
testPop(maxHeap);
/* 获取堆大小 */
int size = maxHeap.Count;