An Optimal Algorithm for Untangling Binary Trees via Rotations
J.-J. Liu, Wen Cheng Yen, Yangjun Chen
Abstract
J.-J. Liu, Wen Cheng Yen, Yangjun Chen
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.
A significance statement is not available in the OpenAlex record.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
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.
Key concepts: Random binary tree, Binary tree, Ternary search tree, Weight-balanced tree, Optimal binary search tree, Mathematics, Time complexity, Tree (set theory)