Example: sequential search
int seqSrch(int a[],int &n, int x)
{ //a[] is an array of n elements
for (int i=0; i<n; i++)
if (a[i] == x) return i;
return -1;
}
Previous slide
Next slide
Back to first slide
View graphic version