English

On Rotation Distance of Rank Bounded Trees

Data Structures and Algorithms 2026-04-08 v3

Abstract

Computing the rotation distance between two binary trees with nn internal nodes efficiently (in poly(n)poly(n) time) is a long standing open question in the study of height balancing in tree data structures. In this paper, we initiate the study of this problem bounding the rank of the trees given at the input (defined by Ehrenfeucht and Haussler (1989) in the context of decision trees). We define the rank-bounded rotation distance between two given binary trees T1T_1 and T2T_2 (with nn internal nodes) of rank at most rr, denoted by dr(T1,T2)d_r(T_1,T_2), as the length of the shortest sequence of rotations that transforms T1T_1 to T2T_2 with the restriction that the intermediate trees must be of rank at most rr. We show that the rotation distance problem reduces in polynomial time to the rank bounded rotation distance problem. This motivates the study of the problem in the combinatorial and algorithmic frontiers. Observing that trees with rank 11 coincide exactly with skew trees (binary trees where every internal node has at least one leaf as a child), we show the following results in this frontier : We present an O(n2)O(n^2) time algorithm for computing d1(T1,T2)d_1(T_1,T_2). That is, when the given trees are skew trees (we call this variant as skew rotation distance problem) - where the intermediate trees are restricted to be skew as well. In particular, our techniques imply that for any two skew trees d(T1,T2)n2d(T_1,T_2) \le n^2. We show the following upper bound : for any two trees T1T_1 and T2T_2 of rank at most r1r_1 and r2r_2 respectively, we have that: dr(T1,T2)n2(1+(2n+1)(r1+r22))d_r(T_1,T_2) \le n^2 (1+(2n+1)(r_1+r_2-2)) where r=max{r1,r2}r = max\{r_1,r_2\}. This bound is asymptotically tight for r=1r=1. En route our proof of the above theorems, we associate binary trees to permutations and bivariate polynomials, and prove several characterizations in the case of skew trees.

Keywords

Cite

@article{arxiv.2304.03985,
  title  = {On Rotation Distance of Rank Bounded Trees},
  author = {Anoop S. K. M. and Jayalal Sarma},
  journal= {arXiv preprint arXiv:2304.03985},
  year   = {2026}
}

Comments

28 pages, 2 figures, Abstract shortened to meet arxiv requirements, accepted journal version