Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
C++ Sequential Search
int search( int a[], int v, int l, int r )
int i;
for ( i = l; i <= r; i++ )
if ( v == a[ i ] ) return i;
return -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment