Since the time complexity of finding the median is O ( log n), it indicate the elements are sorted and binary search for finding the median has been applied.
Since the worst case of time complexity for taking pivot element as median the time complexity will ne O ( n log n)