Burrows–Wheeler transform: Difference between revisions
→{{header|J}}: concise implementation
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
(→{{header|J}}: concise implementation) |
||
Line 958:
)
</syntaxhighlight>
=== concise implementation ===
<syntaxhighlight lang=J>bwt=:verb def '{:"1 /:~(|."0 1~i.@#) (8 u:y),{:a.'
ibwt=: 1 (}.{:) (/:~@,.^:(#@]) 0#"0])</syntaxhighlight>
Example use:
<syntaxhighlight lang=J> bwt'This is a test.'
ssat� tT hiies .
ibwt bwt'This is a test.'
This is a test.</syntaxhighlight>
=={{header|Java}}==
{{trans|Kotlin}}
|