Created
December 27, 2015 14:26
-
-
Save AlexJuca/35acdfd2ee4ff53ec395 to your computer and use it in GitHub Desktop.
linearSearch
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
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