Question: For each problem below, state the largest theoretical lower bound that you can think of and justify. Provide justification for this lower bound. You do
For each problem below, state the largest theoretical lower bound that you can think of and justify. Provide
justification for this lower bound. You do not need to find an algorithm that satisfies this lower bound.
Example: Given an array of size n and a target t determine the index of t in the array.
Example Solution: n because in the worst case any algorithm must look through all n numbers to verify
that the target is not one of them, taking n time.
a Given an array of n numbers, find the second largest number.
b Given an array of n numbers, check to see if there are any duplicates.
c Given an array of n integers with n check to see if there is a pair of elements that add to be an
even number.
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
