Write a method that accepts an integer and an array of integers, and returns true if the integer is contained in the array. The method should use a linear search.
What will be an ideal response?
```
public boolean linearSearch(int a, int[] array)
{
boolean found = false;
int i = 0;
while(i < array.length && !found)
{
if(array[i] == a)
found = true;
i++;
}
return found;
}
```
You might also like to view...
A multihomed customer has which of the following?
a. A single Internet connection b. More than one Internet connection c. Static routes d. None of these answers is correct.
The _____ Mac feature allows you to use an optical drive of another computer on the network
Fill in the blank(s) with correct word
An advantage to using templates is the designer's ability to lock down key parts of the page design while still enabling others to maintain the content.
Answer the following statement true (T) or false (F)
The color orange denotes ____.
A. success B. creativity C. victory D. harmony