Skip to content

Sample implementation of Levenshtein distance algorithm (Calculation between two strings)

Notifications You must be signed in to change notification settings

doyaaaaaken/levenshtein-distance-sample

Repository files navigation

Function to calculate distance between two strings.

This code is sample implementation of Levenshtein distance algorithm. (https://en.wikipedia.org/wiki/Levenshtein_distance) Computational complexity: O(mn)

assertEquals(0, checkDistance("", ""))
assertEquals(0, checkDistance("a", "a"))
assertEquals(1, checkDistance("a", "b"))
assertEquals(1, checkDistance("a", "aa"))
assertEquals(4, checkDistance("abcd", "dcba"))

About

Sample implementation of Levenshtein distance algorithm (Calculation between two strings)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages