Levenshtein Distance Algorithm better than O(n*m)?

前端 未结 4 644
说谎
说谎 2020-11-28 22:49

I have been looking for an advanced levenshtein distance algorithm, and the best I have found so far is O(n*m) where n and m are the lengths of the two strings. The reason w

4条回答
  •  情歌与酒
    2020-11-28 23:09

    I found another optimization that claims to be O(max(m, n)):

    http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#C

    (the second C implementation)

提交回复
热议问题