This commit is contained in:
krahets
2023-09-14 03:34:29 +08:00
parent 847840b649
commit 33edc752c8
7 changed files with 80 additions and 67 deletions
+1 -1
View File
@@ -1135,7 +1135,7 @@ comments: true
/* 元素出堆 */
void pop() {
// 判空处理
if (empty()) {
if (isEmpty()) {
throw out_of_range("堆为空");
}
// 交换根节点与最右叶节点(即交换首元素与尾元素)