Binary tree balancer