Question: 2. Write a pseudocode for the following problem. Given an unsorted array of length n, find the largest gap between any two elements of
2. Write a pseudocode for the following problem. Given an unsorted array of length n, find the largest gap between any two elements of the array. Simply, find max(IA-A, 1) where 1 sis n and 1 sjsn. Explain the complexity of your code, and also provide the tracing of your pseudocode for a small list with at least 4 integers.
Step by Step Solution
3.48 Rating (155 Votes )
There are 3 Steps involved in it
FUNCTION findlargestgaparray SORT array Sorting the array in ascending ord... View full answer
Get step-by-step solutions from verified subject matter experts
