#
A random binary search tree having n nodes, where n=2-1, for same positive integer K, is to be reorganized into a perfectly balanced binary search tree. Outline an efficient algorithm for this task. The algorithm should not use any memory locations other then those already used by the random binary search tree.