Created
January 30, 2015 21:28
-
-
Save t81lal/969ce5af07e86c06e157 to your computer and use it in GitHub Desktop.
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 linearSearch(String[] strings, String finding) { | |
for (int i = 0; i < strings.length; i++) { | |
String s = strings[i]; | |
if (s.equals(finding)) { | |
System.out.println("checked " + i + " words."); | |
System.out.println("Found it at index " + i); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment