I\'m looking to optimize this linear search:
static int linear (const int *arr, int n, int key) { int i = 0; while (i < n) {
You can do it in parallel.
If the list is small, maybe it won't be worth to split the search, but if have to process lots of searches, then you can definitively run them in parallel. That wouldn't reduce the latency of the operations, but would improve the throughput.