Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
. (1)
Since the prex tree can end up being quite large, it
is benecial to prune the tree of unnecessary nodes. For
each node in the tree, we remove all its child nodes if
the value of T
is 0
for a parent node, then the value must be 0 for all of the
child nodes as well. The intuition here is that if a child
node matches a sequence that is not a function start, then
so must the parent node. Thus, if the parent node does
not have any false matches, then neither can a child node.
Based on Equation 1, if T
= 0 and T
+
> 0, then the
weight of the node is 1. Since the child nodes of such a
node also have a T