线性表二分-随手记
原·递归版Position BinarySearch1(List L, ElementType X, int start, int end) { if (start > end) return NotFound; int mid = (start + end) / 2; if (L->Data[mid] == X) return mid; if (L->Data[mid] > X) return BinarySearch1(L, X, start, mid - 1); if (L->Data[mid] < X) return BinarySearch1(L, X, mid + 1, end); } Position BinarySearch(List L, ElementType X) { return BinarySearch1(L, X, 1, L->Last); }改良版·循环Position BinarySearch(List L, ElementType X) { int...