摘要:
1. 直接插入排序 #include <stdio.h> void insertionSort(int arr[], int n) { for (int i = 1; i < n; i++) { int key = arr[i]; int j = i - 1; // 将大于 key 的元素移动到后面 阅读全文
摘要:
顺序查找的实现 #include <stdio.h> #define SIZE 10 // 静态查找表的大小 // 顺序查找函数 int sequentialSearch(int arr[], int size, int target) { for (int i = 0; i < size; i++ 阅读全文