Pergunta de entrevista da empresa UBS

Write a pseudo code to balance a bindary tree.