A linear time algorithm for binary tree sequences transformation using left-arm and right-arm rotations

  • Authors:
  • Ro-Yu Wu;Jou-Ming Chang;Yue-Li Wang

  • Affiliations:
  • Department of Information Management, National Taiwan University of Science and Technology, Taipei, Taiwan, ROC;Department of Information Management, National Taipei College of Business, Taipei, Taiwan, ROC;Department of Computer Science and Information Engineering, National Chi Nan University, Nantou, Taiwan, ROC and Department of Information Management, National Taiwan University of Science and Tec ...

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2006

Quantified Score

Hi-index 5.23

Visualization

Abstract

In this paper, we consider a transformation on binary trees using new types of rotations. Each of the newly proposed rotations is permitted only at nodes on the left-arm or the fight-arm of a tree. Consequently, we develop a linear time algorithm with at most n - 1 rotations for converting weight sequences between any two binary trees. In particular, from an analysis of aggregate method for a sequence of rotations, each rotation of the proposed algorithm can be performed in a constant amortized time. Next, we show that a specific directed rooted tree called rotation tree can be constructed using one of the new type rotations. As a by-product, a naive algorithm for enumerating weight sequences of binary trees in lexicographic order can be implemented by traversing the rotation tree.