Skip to content

Instantly share code, notes, and snippets.

@metallurgix
Created July 7, 2014 07:08
Show Gist options
  • Save metallurgix/4d5dc444adefd75b17ea to your computer and use it in GitHub Desktop.
Save metallurgix/4d5dc444adefd75b17ea to your computer and use it in GitHub Desktop.
Linear Search (C)
int linear_search(int *list,int size, int key)
{
int i;
for(i=0;i<=size;++i)
{
if(key==list[i])
return i;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment