edit distance algorithm in Haskell - performance tuning

前端 未结 6 1806
陌清茗
陌清茗 2020-12-28 09:18

I\'m trying to implement the levenshtein distance (or edit distance) in Haskell, but its performance decreases rapidly when the string lenght increases.

I\'m still q

6条回答
  •  天涯浪人
    2020-12-28 09:32

    You need to memoize editDistance'. There are many ways of doing this, e.g., a recursively defined array.

提交回复
热议问题