Completed tree rotation implementation