Question: 5.21 of your Java textbook Please answer asap, need to submit in 2 hours JAVA!! Given an unsorted array, A , of integers and an

5.21 of your Java textbook

Please answer asap, need to submit in 2 hours

JAVA!!

  1. Given an unsorted array, A, of integers and an integer k, describe a recursive algorithm for rearranging the elements in A so that all elements less than or equal to k come before any elements larger than k. What is the running time of your algorithm on an array of n values?

    1. Write recursive code in java

    2. Write pseudocode for recursive

    3. Write non recursive code in java

    4. Write pseudocode for non recursive

  2. Give running times of both algorithms in Big-O (see details at the bottom)

  3. Construct a table of actual running times of both algorithms by writing programs in the programming language of your choice (Java, C++, Python). (see details at the bottom)

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

b) populate an array with a random number generator.




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!