Question: Create a find method with signature: public static void find(int[] a, int x Method should Receive an array of integers a and integer x perform

Create a find method with signature: public static void find(int[] a, int x

Method should

Receive an array of integers a and integer x

perform a linear search on a for x

In x is in a print the indexes of the array slots where x is stored on the screen

If x is not in a print the message 'x does not exist' on the screen.

This is the code I have so far but it is not 100% correct.

boolean user = false; for(int i=0; i

Code output should be:

5 is in a [0]

5 is in a [2]

5 is in a [7]

10 does not exist

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!