Question: - Choose a fantasy sport to simulate in this program Develop a Java program that meets the following requirements: 1 . In your Java class,

-Choose a fantasy sport to simulate in this program
Develop a Java program that meets the following requirements:
1. In your Java class, develop a class method that meets the following requirements:
(a) has a signature matching int methodName(int[] array, int searchkey),
finds and returns the integer index of sports player number searchkey in the
array array (if it exists)
The signature of a Java method includes its name and the types of its formal
parameters. For example, the formal parameter types of this method are integer
array and integer
(b) has the best Big Oh complexity you can achieve based on the search tech-
niques learned in the efficient algorithms module. In comments above the
method, explain what you believe your methods Big Oh complexity is (con-
stant, logarithmic, linear, quadratic...) and why
Hint: consider sorting your array before searching. Make sure to review the
search algorithm examples in the chapter, and understand their Big Oh com-
plexity.
2. Implement the following in your main method:
(a) Create a map data structure object to hold associations between player number
(key, an integer) and team member name (value, a String). Put an entry into
the map for 3-5 player numbers, giving each member a unique name
For example, one entry could have the key 23 and value Michael Jordan
(b) Obtain the player numbers from the map, and add them all to a set data struc-
ture. Then, demonstrate checking whether the set contains a particular player
number of your choice.
(c) Copy and insert the player numbers into an array, then search for the same
player number in the array using your search method 1.

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 Programming Questions!