Suffix tree: Difference between revisions

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

edits