According to the problem description ,
We need to find the median so we know if :
Time needed to find median = O(n) using selection algorithm
Now for recursive parts we are considering the left and right subtrees and these are of almost same sizes.
Hence if T(n) is complexity of entire problem so for subproblems we need 2T(n/2) time..And O(n) for median finding as mentioned earlier..Hence recurrence relation for time T(n) will be :
T(n) = 2T(n/2) + O(n)
==> T(n) = O(nlogn) by Masters theorem
Hence correct answer is O(nlogn)