## Untangling binary trees via rotations

Venue: | Comput. J |

Citations: | 2 - 0 self |

### BibTeX

@ARTICLE{Lucas_untanglingbinary,

author = {Joan M. Lucas},

title = {Untangling binary trees via rotations},

journal = {Comput. J},

year = {},

volume = {47},

pages = {259--269}

}

### OpenURL

### Abstract

In this paper we present a polynomial time algorithm for finding the shortest sequence of rotations that converts one binary tree into another when both binary trees are of a restricted form. The initial tree must be a degenerate tree, where every node has exactly one child, and the destination binary tree must also be degenerate, of a more restricted nature. Previous work on rotation distance has focused on approximation algorithms. Our algorithm is the only known non-trivial polynomial time algorithm for exact rotation distance between special cases of binary trees. 1.

### Citations

8542 |
Introduction to Algorithms
- Cormen, Leiserson, et al.
- 1990
(Show Context)
Citation Context ...h. We use the notation CS(T0,Tf) to denote a common subsequence between the vertical orders of T0 and Tf which is not necessarily maximum. A longest common subsequence can be computed in O(n 2 ) time =-=[28]-=- using a dynamic programming algorithm. It is straightforward to ensure that our algorithm selects a normal LCS, when one exists. First, we run the standard LCS algorithm. If the first LCS generated i... |

372 |
Self-adjusting binary search trees
- Sleator, Tarjan
- 1985
(Show Context)
Citation Context ...ce between special cases of binary trees. 1. INTRODUCTION The binary tree is a fundamental data structure in computer science. Binary search trees have been extensively studied over the past 40 years =-=[1, 2, 3, 4, 5, 6, 7]-=-. One of the most common operations for restructuring a binary tree is the rotation operation (Figure 1). The rotation is a simple, constant time operation which preserves the symmetric order of the n... |

231 |
R.: A dichromatic framework for balanced trees
- Guibas, Sedgewick
- 1978
(Show Context)
Citation Context ...ce between special cases of binary trees. 1. INTRODUCTION The binary tree is a fundamental data structure in computer science. Binary search trees have been extensively studied over the past 40 years =-=[1, 2, 3, 4, 5, 6, 7]-=-. One of the most common operations for restructuring a binary tree is the rotation operation (Figure 1). The rotation is a simple, constant time operation which preserves the symmetric order of the n... |

179 |
An algorithm for the organization of information
- Adelson-Velskii, Landis
- 1962
(Show Context)
Citation Context ...ce between special cases of binary trees. 1. INTRODUCTION The binary tree is a fundamental data structure in computer science. Binary search trees have been extensively studied over the past 40 years =-=[1, 2, 3, 4, 5, 6, 7]-=-. One of the most common operations for restructuring a binary tree is the rotation operation (Figure 1). The rotation is a simple, constant time operation which preserves the symmetric order of the n... |

114 |
Symmetric binary B-trees: Data structure and maintenance algorithms
- Bayer
- 1972
(Show Context)
Citation Context |

110 | Rotation distance, triangulations, and hyperbolic geometry
- Sleator, Tarjan, et al.
- 1988
(Show Context)
Citation Context ...of ‘folding’ and ‘unfolding’. Their technique is of importance to us, and will be detailed later. This bound was improved to 2n−6, for infinitely many n, n ≥ 11, by Sleator, Tarjan and Thurston (STT) =-=[19]-=-. Sleator et al. used the wellknown one-to-one correspondence between binary trees of n nodes and triangulations of an n+2 vertex convex polygon [19, 20]. The root of the binary tree corresponds to th... |

80 |
Binary search trees of bounded balance
- Nievergelt, Reingold
- 1973
(Show Context)
Citation Context |

31 | On rotations and the generation of binary trees
- Lucas, Baronaigien, et al.
(Show Context)
Citation Context ...given by the Catalan number C(n) = 1/(n + 1) �2n� n . Thus the graph RG(n) is exponentially large with respect to n. Enumerating binary trees with a Gray code with respect to rotations was studied in =-=[8, 9]-=-, where they established that RG(n) is Hamiltonian. An alternative loopless generating A x y B C right rotation of edge(x,y) left rotation of edge (x,y) FIGURE 1. Received 29 October 2002; revised 17 ... |

31 |
A note on some tree similarity measures
- Culik, Wood
- 1982
(Show Context)
Citation Context ...mpute RotDist(T0,Tf) in exponential time using a breadth-first-search of RG(n). However, it remains an open problem whether rotation distance can be determined in time polynomial in n. Culik and Wood =-=[18]-=- showed a simple upper bound of 2n − 2 on RotDist(T0,Tf) for any T0 and Tf. They use the technique of ‘folding’ and ‘unfolding’. Their technique is of importance to us, and will be detailed later. Thi... |

29 |
M.: Graph of triangulations of a convex polygon and tree of triangulations
- Hurtado, Noy
- 1999
(Show Context)
Citation Context ... n − 1 connected, has radius n − 1, and characterized the set of nodes that form the center of RG(n). In [12] they present further results characterizing the diametral nodes of RG(n). Hurtado and Noy =-=[13]-=- generalized the concept of the finite graph RG(n) into an infinite tree and were thus able to give new and simpler proofs for Hamiltonicity, connectivity and characterizing the center of RG(n). Pallo... |

22 |
On the deque conjecture for the splay algorithm
- Sundar
- 1992
(Show Context)
Citation Context ...partially ordered set with a unique maximum and minimum, known as the nth Tamari lattice. This corresponds to the case when only left rotations are permitted in the binary tree transformation. Sundar =-=[17]-=- also studied transformations of binary trees when only a single direction of rotation is permitted; in his case, only right rotations. He gave upper and lower bounds on the number of combinations of ... |

21 |
The rotation graph of binary trees is Hamiltonian
- Lucas
- 1987
(Show Context)
Citation Context ...given by the Catalan number C(n) = 1/(n + 1) �2n� n . Thus the graph RG(n) is exponentially large with respect to n. Enumerating binary trees with a Gray code with respect to rotations was studied in =-=[8, 9]-=-, where they established that RG(n) is Hamiltonian. An alternative loopless generating A x y B C right rotation of edge(x,y) left rotation of edge (x,y) FIGURE 1. Received 29 October 2002; revised 17 ... |

19 | General balanced trees
- Andersson
- 1999
(Show Context)
Citation Context |

19 |
Enumerating, ranking and unranking binary trees
- Pallo
- 1986
(Show Context)
Citation Context ...generalized the concept of the finite graph RG(n) into an infinite tree and were thus able to give new and simpler proofs for Hamiltonicity, connectivity and characterizing the center of RG(n). Pallo =-=[14, 15, 16]-=- shows that a directed version of RG(n) is a lattice, that is, is a partially ordered set with a unique maximum and minimum, known as the nth Tamari lattice. This corresponds to the case when only lef... |

19 | The edge-flipping distance of triangulations
- Hanke, Ottmann, et al.
- 1996
(Show Context)
Citation Context ...ed here can do many intermixed left and right rotations. Other polynomial time heuristic algorithms for computing an upper bound on RotDist(T0,Tf) are given in Rogers and Dutton [12] and Hanke et al. =-=[24]-=-. More recently Rogers [25] has presented an O(n log n) algorithm for finding a path from T0 to Tf in RG(n) whose length is at most twice RotDist(T0,Tf). Closely related problems have been studied by ... |

12 |
On the Rotational Distance in the Lattice of Binary Trees
- Pallo
- 1987
(Show Context)
Citation Context ...generalized the concept of the finite graph RG(n) into an infinite tree and were thus able to give new and simpler proofs for Hamiltonicity, connectivity and characterizing the center of RG(n). Pallo =-=[14, 15, 16]-=- shows that a directed version of RG(n) is a lattice, that is, is a partially ordered set with a unique maximum and minimum, known as the nth Tamari lattice. This corresponds to the case when only lef... |

12 |
Canonical forms for competitive binary search tree algorithms
- Lucas
- 1988
(Show Context)
Citation Context ...ain theorem shows that any ‘crick’ rotations (i.e. (white, black) rotations that do not correspond to an STT rotation or to the cross-over rotation) are never useful. This is similar to the result in =-=[29]-=-. There it was shown that given any sequence of search operations in a binary search tree, where each successive target node zi is rotated to the root of the binary search tree (as is done in the spla... |

10 |
An efficient upper bound of the rotation distance of binary trees
- Pallo
- 2000
(Show Context)
Citation Context ...for a bound on the diameter of RG(n) are given by Makinen [21] and Luccio and Pagli [22]. Several authors have presented approximation algorithms for the problem of computing rotation distance. Pallo =-=[23]-=- presents a polynomial time algorithm for finding an upper bound on RotDist(T0,Tf). The proof is constructive, and it is possible to build the actual sequence of rotations transforming T0 to Tf, but w... |

8 |
On finding shortest paths in the rotation graph of binary trees, Congressus Numerantium 197
- Rogers
- 1999
(Show Context)
Citation Context ...xed left and right rotations. Other polynomial time heuristic algorithms for computing an upper bound on RotDist(T0,Tf) are given in Rogers and Dutton [12] and Hanke et al. [24]. More recently Rogers =-=[25]-=- has presented an O(n log n) algorithm for finding a path from T0 to Tf in RG(n) whose length is at most twice RotDist(T0,Tf). Closely related problems have been studied by Bonnin and Pallo [26] and C... |

7 |
Some properties of the rotation lattice of binary trees
- Pallo
- 1988
(Show Context)
Citation Context ...generalized the concept of the finite graph RG(n) into an infinite tree and were thus able to give new and simpler proofs for Hamiltonicity, connectivity and characterizing the center of RG(n). Pallo =-=[14, 15, 16]-=- shows that a directed version of RG(n) is a lattice, that is, is a partially ordered set with a unique maximum and minimum, known as the nth Tamari lattice. This corresponds to the case when only lef... |

6 |
On the loopless generation of binary tree sequences
- Vajnovszki
- 1998
(Show Context)
Citation Context ...otation of edge(x,y) left rotation of edge (x,y) FIGURE 1. Received 29 October 2002; revised 17 June 2003 A x B y C The Computer Journal, Vol. 47, No. 2, 2004 algorithm was presented by Vajnovszki in =-=[10]-=-. Rogers and Dutton [11] showed that RG(n) is n − 1 connected, has radius n − 1, and characterized the set of nodes that form the center of RG(n). In [12] they present further results characterizing t... |

6 |
On the upper bound on the rotation distance of binary trees
- Luccio, Palgi
- 1989
(Show Context)
Citation Context ... from this framework of triangulations. We prefer to state our results in terms of binary trees. Alternative proofs for a bound on the diameter of RG(n) are given by Makinen [21] and Luccio and Pagli =-=[22]-=-. Several authors have presented approximation algorithms for the problem of computing rotation distance. Pallo [23] presents a polynomial time algorithm for finding an upper bound on RotDist(T0,Tf). ... |

5 |
On the rotation distance of binary trees
- Mäkinen
- 1988
(Show Context)
Citation Context ...in this area has been done from this framework of triangulations. We prefer to state our results in terms of binary trees. Alternative proofs for a bound on the diameter of RG(n) are given by Makinen =-=[21]-=- and Luccio and Pagli [22]. Several authors have presented approximation algorithms for the problem of computing rotation distance. Pallo [23] presents a polynomial time algorithm for finding an upper... |

5 |
Restricted rotation distance between binary trees
- Cleary
(Show Context)
Citation Context ...resented an O(n log n) algorithm for finding a path from T0 to Tf in RG(n) whose length is at most twice RotDist(T0,Tf). Closely related problems have been studied by Bonnin and Pallo [26] and Cleary =-=[27]-=-. These authors approach the problem by limiting the reshaping primitive to a restricted version of the general rotation operation. Bonnin and Pallo present an O(n 2 ) algorithm to compute the restric... |

4 |
On distance in the rotation graph of binary trees
- Rogers, Dutton
- 1996
(Show Context)
Citation Context ...t rotation of edge (x,y) FIGURE 1. Received 29 October 2002; revised 17 June 2003 A x B y C The Computer Journal, Vol. 47, No. 2, 2004 algorithm was presented by Vajnovszki in [10]. Rogers and Dutton =-=[11]-=- showed that RG(n) is n − 1 connected, has radius n − 1, and characterized the set of nodes that form the center of RG(n). In [12] they present further results characterizing the diametral nodes of RG... |

3 |
A shortest path metric on unlabeled binary trees
- unknown authors
- 1992
(Show Context)
Citation Context ...ogers [25] has presented an O(n log n) algorithm for finding a path from T0 to Tf in RG(n) whose length is at most twice RotDist(T0,Tf). Closely related problems have been studied by Bonnin and Pallo =-=[26]-=- and Cleary [27]. These authors approach the problem by limiting the reshaping primitive to a restricted version of the general rotation operation. Bonnin and Pallo present an O(n 2 ) algorithm to com... |

2 |
Dynamic binary search trees
- MEHLHORN
- 1979
(Show Context)
Citation Context |

1 |
Catalan polytopes and triangulations of the n-gon. Abteilung Fur Mathematik der Ruhr-Universitat Bochum
- Lee
- 1984
(Show Context)
Citation Context ...y n, n ≥ 11, by Sleator, Tarjan and Thurston (STT) [19]. Sleator et al. used the wellknown one-to-one correspondence between binary trees of n nodes and triangulations of an n+2 vertex convex polygon =-=[19, 20]-=-. The root of the binary tree corresponds to the tops260 J. M. Lucas edge of the polygon, and each remaining node corresponds to a diagonal of the triangulation. A rotation in the binary tree correspo... |