Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editDistance bug? #22

Open
zhaomingli007 opened this issue Jan 22, 2019 · 0 comments
Open

editDistance bug? #22

zhaomingli007 opened this issue Jan 22, 2019 · 0 comments

Comments

@zhaomingli007
Copy link

case (a, b) => (delete + f(a, b.tail)) min (insert + f(a.tail, b)) min (replace + f(a.tail, b.tail))

When call editDistance(List("c"),List("b"),2,1,5), the expected cost should be 3 (one deletion + one addition). Now it returns 2.

Probably it can be modified as below?

    case (a, b) => (delete + f(a.tail, b)) min (insert + f(a.tail, a.head :: b)) min (replace + f(a.tail, b.tail))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant