I\'m looking to optimize this linear search:
static int
linear (const int *arr, int n, int key)
{
int i = 0;
while (i < n) {
In reality, the answer to this question is 100% dependent on the platform you're writing the code for. For example:
CPU : Memory speed | Example CPU | Type of optimisation
========================================================================
Equal | 8086 | (1) Loop unrolling
------------------------------------------------------------------------
CPU > RAM | Pentium | (2) None