Skip to content

Instantly share code, notes, and snippets.

@AlexJuca
Created December 27, 2015 14:26
Show Gist options
  • Save AlexJuca/35acdfd2ee4ff53ec395 to your computer and use it in GitHub Desktop.
Save AlexJuca/35acdfd2ee4ff53ec395 to your computer and use it in GitHub Desktop.
linearSearch
public static void findStudent(int key, int[] studentList) {
int N = studentList.length;
for(int i = 0; i < N; i++) {
if(studentList[i] == key) {
System.out.println("Key has been found");
} else System.out.println(" Key was not found ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment