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
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