Given an unsorted array A[1…N], trying to find the K numbers in A that are closes in value to the median of A.

I can find the median of A in linear time O(N). Can I also find K in linear time??

for example.

A = [9,2,7,3,8,1,12}, Median(A) = 7, and 3 items with closes values to 7 are {7,8,9}.

# Find closest in value to the median of S

**baehs89**#1