UBS interview question

Write a pseudo code to balance a bindary tree.