堆排序:升序輸出

核心思想: 要求升序輸出,也就是從小到大排列 1.建大堆: 關鍵:在於向下調整 2.建好大堆後,循環刪除堆頂元素 關鍵在於:堆頂元素與最後一個元素進行交換 1.sort.hweb #pragma once #include <stdio.h> #include <stdlib.h> #include <string.h> void Swap(int *a, int *b
相關文章
相關標籤/搜索