Question: Objective Demonstrate knowledge of recursion by describing common applications and by effectively using it to solve problems. Use of appropriate algorithms to solve common computing
Objective
Demonstrate knowledge of recursion by describing common applications and by effectively
using it to solve problems.
Use of appropriate algorithms to solve common computing problems.
Problem
In this assignment, you will write a guessing game. In this program, you will create an array of
elements and write a method that randomly generates integer values between and
inclusive The method then uses the Java builtin sort function Arrays.sortmyArray to sort
the array in ascending order and returns the sorted array. The program then asks the user to think
of an integer between and The program then uses a modified binary search algorithm to
guess the value.
The program may ask the user a question such as Is your number greater than See below for
example sample runs. Your program should have a worstcase time of Olog n where n is the size
of the collection object.
Sample run #: Value NOT FOUND in the collection target
Choose a random number between and
For the following questions, enter Y for Yes or N for No
Is your number greater than y
Is your number n
Is your number greater than n
Is your number n
Is your number greater than n
Is your number n
Is your number greater than n
Is your number n
Is your number greater than y
Is your number n
SORRY! Your number is not in the collection.
Here is the Collection:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
