Definition
An instance D of the data type dynamic_trees is a set of dynamically changing rooted trees. Each edge is directed towards the root and has a weight. Optionally, user defined information can be stored at the vertices and at the edges.
Remark Dynamic trees are very similar to the data type tree_collection. The main difference is that the former use edge weights instead of the node weights used by the latter.
#include < LEDA/dynamic _trees.h >
Creation
dynamic_trees | D | creates an empty instance D of type dynamic_trees. |
Operations
Implementation
Dynamic Trees are implemented using binary trees with the randomized balancing scheme by Aragon and Seidel. Each operation takes O(log2n) amortized expected time except for make which takes constant time. n is the current number of nodes.