Given is:
- An array of length
N. - The array contains integers.
- The integers are not necessarily sorted.
Find an algorithm that:
- Returns (a close approximation of)the
K-th smallest array element. - Has a runtime complexity of O(
NlogN) and a space complexity of O(logN). - The algorithm needn't be deterministic. In case of a probabilistic algorithm also provide a measure for the quality of the approximated result.