Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help!!! - Make sure that you write the comment for each question - you only need I Java file for this homework, and everything
please help!!! - Make sure that you write the comment for each question - you only need I Java file for this homework, and everything sinoulo work - In this program, you will have at least 3 methods - main, linearSearch, and binarySearch. - main - the main method, you will - define 3 integer arrays and initial values to the value in question 1, 3, and 5 in the exercise (data_ X1, data_XXX3, data_XXX5), where XXX are your initials (first, middle, last) - you will ask the user to enter a target search value (target_XXX) - then you will perform linear search on all 3 arrays and provide results - found at the index or not found. FORMAT your input/output screen nice and neatly. - Linear Search on data XXX1 - Linear Search on data XXX3 - Linear Search on data XXX5 - Binary Search on data XXX5 - RUN twice - first time with 27 as a target, and then 2 nd time with 13 as a target. - linearsearch - this method will accept an array of integer and a target search; and then return an integer, representing the position that this target is found " if not found, this method will return -1 - binarysearch - this method will accept a sorted array of integer and a target search; and then return an integer, representing the position that this target is found " if not found, this method will return -1 Searching Exercises: 1. Linear Search: Target =27 2. Linear Search: Target =13 3. Linear Search: Target =27 4. Linear Search: Target =13 5. Binary Search: Target =27
please help!!!
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