ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
PartialRebuildingTree.h

Three trees balanced by partial rebuilding, from exercises 8.8 to 8.10 of Morin, beyond the book. More...

Files

file  ADS/tree/PartialRebuildingTree.h
 Three trees balanced by partial rebuilding, from exercises 8.8 to 8.10 of Morin, beyond the book: binary search trees whose insertions and removals are those of the plain tree, followed by the rebuilding of the subtree of the highest node of the path that a rule selects into a perfectly balanced one [see ScapegoatTree.h for the rebuild].

Classes

class  ADS::PartialRebuildingTree< K, V, P >
 a DICTIONARY on a binary search tree balanced by partial rebuilding by the rule P More...

Typedefs

template<std::totally_ordered K, class V>
using ADS::WeightRebuildTree
 the tree of exercise 8.8 of Morin, balanced by weight by rebuilds
template<std::totally_ordered K, class V>
using ADS::CountdownTree
 the CountdownTree of exercise 8.9 of Morin
template<std::totally_ordered K, class V>
using ADS::DynamiteTree = PartialRebuildingTree< K , V , RebuildPolicy::DYNAMITE >
 the DynamiteTree of exercise 8.10 of Morin

Enumerations

enum class  ADS::RebuildPolicy { ADS::RebuildPolicy::WEIGHT , ADS::RebuildPolicy::COUNTDOWN , ADS::RebuildPolicy::DYNAMITE }
 the rules that select the subtree to rebuild More...

Detailed description

Three trees balanced by partial rebuilding, from exercises 8.8 to 8.10 of Morin, beyond the book.

The definitions, the invariants and the costs of the area are in Theory of trees.

Typedef documentation

◆ CountdownTree

template<std::totally_ordered K, class V>
using ADS::CountdownTree
Initial value:
a DICTIONARY on a binary search tree balanced by partial rebuilding by the rule P
Definition PartialRebuildingTree.h:129
@ COUNTDOWN
a timer set to that runs out
Definition PartialRebuildingTree.h:117

the CountdownTree of exercise 8.9 of Morin

◆ DynamiteTree

template<std::totally_ordered K, class V>
using ADS::DynamiteTree = PartialRebuildingTree< K , V , RebuildPolicy::DYNAMITE >

the DynamiteTree of exercise 8.10 of Morin

◆ WeightRebuildTree

template<std::totally_ordered K, class V>
using ADS::WeightRebuildTree
Initial value:
@ WEIGHT
Definition PartialRebuildingTree.h:116

the tree of exercise 8.8 of Morin, balanced by weight by rebuilds

Enumeration type documentation

◆ RebuildPolicy

enum class ADS::RebuildPolicy
strong

the rules that select the subtree to rebuild

Enumerator
WEIGHT 

\( s( u ) \le \frac23 s( u.\mathit{parent} ) \)

COUNTDOWN 

a timer set to \( s( u ) / 3 \) that runs out

DYNAMITE 

an explosion with probability \( 1 / s( u ) \)