class documentation

class EulerTour:

View In Hierarchy

Abstract base class for performing Euler tour of a tree.

_hook_previsit and _hook_postvisit may be overridden by subclasses.

Method __init__ Prepare an Euler tour template for given tree.
Method execute Perform the tour and return any result from post visit of root.
Method tree Return reference to the tree being traversed.
Method _hook_postvisit Visit Position p, after the tour of its children.
Method _hook_previsit Visit Position p, before the tour of its children.
Method _tour Perform tour of subtree rooted at Position p.
Instance Variable _tree Undocumented
def __init__(self, tree):

Prepare an Euler tour template for given tree.

def execute(self):

Perform the tour and return any result from post visit of root.

def tree(self):

Return reference to the tree being traversed.

def _hook_postvisit(self, p, d, path, results):

Visit Position p, after the tour of its children.

p Position of current position being visited d depth of p in the tree path list of indices of children on path from root to p results is a list of values returned by _hook_postvisit(c) for each child c of p.

def _hook_previsit(self, p, d, path):

Visit Position p, before the tour of its children.

p Position of current position being visited d depth of p in the tree path list of indices of children on path from root to p

def _tour(self, p, d, path):

Perform tour of subtree rooted at Position p.

p Position of current node being visited d depth of p in the tree path list of indices of children on path from root to p

_tree =

Undocumented