Synopsys interview question

balance a binary tree (binary search)