Amortized rigidness in dynamic cartesian trees

  • Authors:
  • Iwona Bialynicka-Birula;Roberto Grossi

  • Affiliations:
  • Dipartimento di Informatica, Università di Pisa, Pisa, Italy;Dipartimento di Informatica, Università di Pisa, Pisa, Italy

  • Venue:
  • STACS'06 Proceedings of the 23rd Annual conference on Theoretical Aspects of Computer Science
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Cartesian trees have found numerous applications due to a peculiar rigid structure whose properties can be exploited in various ways. This rigidness, however, is also an obstacle when updating the structure since it can lead to a very unbalanced shape and so up to now most applications either assumed a random distribution of the keys or considered only the static case. In this paper we present a framework for efficiently maintaining a Cartesian tree under insertions and weak deletions in O(log n) amortized time per operation, using O(n) space. We show that the amortized cost of updating a Cartesian tree is $O(1 + \mathcal{H}(T)/n)$ where $\mathcal{H}(T) = O(nlogn)$ is an entropy-related measure for the partial order encoded by T. We also show how to exploit this property by implementing an algorithm which performs these updates in O(log n) time per operation. No poly-logarithmic update bounds were previously known.