分块查找:先定块,再块内顺序查找

目标 key = 19;索引表保存每块最大关键字。
int block_search(const int a[], const IndexBlock idx[], int block_count, int key) {
    int block = lower_bound_block(idx, block_count, key);
    if (block == block_count) return -1;

    for (int i = idx[block].start; i <= idx[block].end; ++i) {
        if (a[i] == key) return i;
    }
    return -1;
}