Fastest possible search in small arrays with different methods

CrossRoads:
Why not make a simpler table?
array[] = {a,a1,b,b1,c,c1,d,d1,e,e1,f,f1...,};

then search the array in 2s:

for (x=0, x<upperLimit; x=x+2){

if (array[x] == searchTerm){output = array[x+1];}
}



Only have to go thru list once and you have the result.

interesting idea, but

  • the amount of math to calculate the addresses is identical
    (you go through n steps of search followed by 1 in the 'odd-er' array.
  • it assumes that the elements of both arrays are the same type.
  • maintaining the array contents is a bit more difficult