An optimal algorithm for untangling binary trees via rotations - Liu, Jia-Jie.