pseudocode of a possible algorithm for linear search, generally applicable to unsorted sequences/lists.
We assume that the list index starts with 1, i.e. first item of the list is a[1]=a1, and the ith item is a[i]=ai.
value:v; // define and initialize comparison variable
v:nil;Â Â Â // prescribed special value
i:0Â Â Â Â Â // define and initialize counter
while (i<n and v==nil) do{Â Â // terminates while if value found, or n cycles reached
 i:i+1;
 if a[i]==value then v=i;  // index of matching value
}
// if value not found, v=nil, else v=i, the index of the list/array where found