you give array length n find subarray alr length k large medianA median array length n element occupie position number lfloor fracn 12 rfloor sort element nondecrease order for example median1 2 3 4 2 median3 2 1 2 median2 1 2 1 1subarray alr contiguous array ie array a_la_l1ldotsa_r 1 leq l leq r leq n length r l 1