Kth Smallest Fraction
Kth Smallest Fraction Kth Smallest Fraction selects the k-th smallest value among fractions of the form: $$ \frac{A[i]}{A[j]} $$ where the array $A$ is sorted and: $$ 0 \le i < j < n $$ This problem appears in number theory and ranking problems. Direct enumeration gives $O(n^2)$ fractions, which is too large. Problem Given a sorted array $A$ of positive integers and an integer $k$, return the k-th smallest...