Burrows–Wheeler transform: Difference between revisions

(Initial Haskell version.)
Line 298:
 
invBwt :: Ord a => BWT a -> [a]
invBwt (BWT xs) = let ys = foldriterate step (map (const []) xs) !! length xs
in unpos $ fromJust $ find ((== Post) . last) ys
where step _ = sort . zipWith (:) xs
 
 
Anonymous user