Created
July 7, 2014 07:08
-
-
Save metallurgix/4d5dc444adefd75b17ea to your computer and use it in GitHub Desktop.
Linear Search (C)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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