Question: 3. (20 points) Consider an unordered array A of n distinct integers, and two integers j and k, such that 1 j k n. For

3. (20 points) Consider an unordered array A of n distinct integers, and two integers j and k, such that 1 j k n. For any x E A, define x's rank to be l{z A : z . Give an algorithm that runs in O(n) time to find the integers in A whose ranks lie in the interval [j, k]. Prove your algorithm's correctness and argue its time complexity
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
