Amazon Interview Question

Write a program that balances an unbalanced binary tree.