Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started