Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It looks like you get this algorithm almost directly if you just memoise a very simple recursive Levenshtein distance function.

(This insight could be implemented directly in Haskell by using e.g. the MemoTrie package)

The standard imperative Levenshtein algorithm (with dynamic programming) is also basically just a memoised version of that recursive version -- except that the memoisation is cleared immediately after the result you originally asked for is returned.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: