Abstract

There are various ways to measure the shape difference between two n-node rooted binary trees (binary trees for short). A rotation on a binary tree is a local restructuring that changes the tree into another one preserving the in-order sequence. The rotation distance between two binary trees is the minimum number of rotations needed to transform one into another. Till now, no polynomial–time algorithm exists for computing the rotation distance between any two binary trees. Recently, Lucas (Comput. J., 47, 259–269, 2004) presented an O(n2)–time algorithm for finding the rotation distance between two binary trees, where the source tree is a degenerate tree and the destination tree is an angle tree. This paper improves the time-complexity to O(n) under this constraint.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call