Naive Builder — suffix-tree 0.1.1 documentation

# Naive Builder

A naive tree builder.

This builder uses a naive algorithm to build a suffix tree in \(\mathcal{O}(n^2)\) time.

This implementation closely follows the description in [Gusfield1997] §5.4 page 93.

class Builder

  Builds the suffix-tree using a naive algorithm.

  build(root: Internal, id_: object, S: Iterable[Hashable]) → None

    Add a sequence to the tree.

    Parameters:

      - root (node.Internal) – the root node of the tree

      - id (Id) – the id of the sequence

      - S (Symbols) – the sequence to insert