Suffix tree: Difference between revisions
m
→{{header|Perl 6}}: stabilize output, work-around for JVM bug
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: fix markup) |
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: stabilize output, work-around for JVM bug) |
||
Line 557:
=={{header|Perl 6}}==
{{Works with|Rakudo|2018.
Here is quite a naive algorithm, probably <math>O(n^2)</math>.
Line 588:
) {
sub visit($node, *@pre) {
take @pre[0] ~ $node.&label;
my @children
my $end = @children.end;
for @children.kv -> $_, $child {
Line 598:
}
}
flat visit($tree, $indent xx 2);
}</lang>
|