(i) Find the location of the median element.
(ii) Rotate it up to the root.
(iii) Apply the algorithm recursively to the two subtrees.
(a) Prove that the resulting tree is balanced; that is, show that it has paths of length O(log n).
(b) Argue that the worst-case running time of this algorithm is Theta(n log n).
(c) Can you come up with a better algorithm? (Hint. O(n) is possible.)