Question: Given an unsorted sequence S of n comparable elements, and an integer k, give an O(n log k) expected-time algorithm for finding the O(k) elements
Given an unsorted sequence S of n comparable elements, and an integer k, give an O(n log k) expected-time algorithm for finding the O(k) elements that have rank [n/k], 2[n/k], 3[n/k], and so on.
Provide pseudocode for the algorithm.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
