Question: please needed in 2 hours JAVA: A) Suppose you are given an array, A , containing n distinct integers that are listed in increasing order.

please needed in 2 hours

JAVA:

A) Suppose you are given an array, A, containing n distinct integers that are listed in increasing order. Given a number k, describe a recursive algorithm to find two integers in A that sum to k, if such a pair exists. What is the running time of your algorithm?

B) Also, write 1 non-recursive method in JAVA

C)

  • Give running times of both algorithms in Big-O (see details at the bottom)
  • Construct a table of actual running times of both algorithms by writing programs in the programming language of your choice (Java)

a) with array sizes 100, 1000, and 10000 of array

b) populate an array with a random number generator.

D) give pseudocode for both programs

Running time table should have algo name algo type input areay size and running time in micro seconds

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!