五、請實作下列函式以完成設計 1 個插入排序法(Insertion Sort),據以依參數值決定排序方式採遞增或遞減。(18 分) bool isInverse(int x, int y, bool isAsc); //判斷傳入的 x、y 是否反序 void InsertionSort(int *arr, int len, bool isAsc); //插入排序 (註:參數 arr 為傳入的整數陣列;參數 len 為整數陣列的長度;參數 isAsc 為是否遞增, 函式 InsertionSort 應呼叫函式 isInverse。)
詳解 (共 1 筆)
佳佳
詳解 #6233444
使用C++實作如下: #include...
(共 1144 字,隱藏中)
前往觀看