Balancing weighted strings and trees in linear time - Archive ouverte HAL Accéder directement au contenu
Pré-Publication, Document De Travail Année : 2012

Balancing weighted strings and trees in linear time

Résumé

In the present paper, we address the problem of building a binary tree whose leaves carry weights in a given order and which is in some sense balanced. Such a tree is denoted as a balanced alphabetic weighted tree. If the leaves of the tree are labeled with letters, their concatenation (from left to right) gives a weighted string. The tree is balanced if it minimizes the maximum of all root-to-leaf path weights. The root-to-leaf path weight for a given leaf is the sum of its depth and a function of its weight. There already exist linear algorithms to balance alphabetic weighted trees, using some extra hypothesis on the weights (for example if the number of distinct integer parts of the weights is bounded). The algorithm presented here is an online algorithm, which uses neither sorting nor extra data structures nor extra hypothesis on the weights. It applies to positive weights (either integers or reals). We use this algorithm to balance binary trees representing graphs in linear time.
Fichier principal
Vignette du fichier
article.pdf (238.89 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-00708337 , version 1 (14-06-2012)
hal-00708337 , version 2 (03-06-2013)

Identifiants

  • HAL Id : hal-00708337 , version 2

Citer

Frédérique Carrere. Balancing weighted strings and trees in linear time. 2012. ⟨hal-00708337v2⟩

Collections

CNRS TDS-MACS
141 Consultations
206 Téléchargements

Partager

Gmail Facebook X LinkedIn More