Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int linearSearch(int x, int[] arr) {
- int i = 0;
- while (arr[i] != Integer.MIN_VALUE) {
- if (arr[i] == x) return arr[i];
- i++;
- }
- return Integer.MIN_VALUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement