Suffix tree: Difference between revisions

Content added Content deleted
m (→‎{{header|Sidef}}: Fix link: Perl 6 --> Raku)
m (→‎{{header|Raku}}: Fix link: Perl 6 --> Raku)
Line 1,010: Line 1,010:
Here is quite a naive algorithm, probably <math>O(n^2)</math>.
Here is quite a naive algorithm, probably <math>O(n^2)</math>.


The display code is a variant of the [[visualize_a_tree#Perl6|visualize a tree]] task code.
The display code is a variant of the [[visualize_a_tree#Raku|visualize a tree]] task code.


<lang perl6>multi suffix-tree(Str $str) { suffix-tree flat map &flip, [\~] $str.flip.comb }
<lang perl6>multi suffix-tree(Str $str) { suffix-tree flat map &flip, [\~] $str.flip.comb }