Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. static int linearSearch(int x, int[] arr) {
  2. int i = 0;
  3. while (arr[i] != Integer.MIN_VALUE) {
  4. if (arr[i] == x) return arr[i];
  5. i++;
  6. }
  7. return Integer.MIN_VALUE;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement