cosmos icon indicating copy to clipboard operation
cosmos copied to clipboard

Add edit distance solution

Open Vitorvgc opened this issue 9 years ago • 15 comments

Add the code for edit distance problem.

Problem statement: Given two strings and three types of operation (insert, remove and replace a character), find the minimum number of operations needed to convert the first string into the second.

The code should be added at code/dynamic_programming/edit_distance

Vitorvgc avatar Oct 02 '17 15:10 Vitorvgc

Added the first implementation in C++: #180

Vitorvgc avatar Oct 02 '17 15:10 Vitorvgc

@AdiChat I would like to work on it by using Python Language

rahulg963 avatar Oct 02 '17 15:10 rahulg963

@rahulg963 Go for it 👍

AdiChat avatar Oct 02 '17 17:10 AdiChat

I would go for C version. Please assign @AdiChat

NishantTanwar avatar Oct 02 '17 22:10 NishantTanwar

Go ahead 👍

I have send you an invite

AdiChat avatar Oct 03 '17 04:10 AdiChat

@AdiChat please review #233 I have added

NishantTanwar avatar Oct 03 '17 10:10 NishantTanwar

Issue #181 Added #233 pls review.

NishantTanwar avatar Oct 03 '17 10:10 NishantTanwar

I am about to add an implementation in Haskell.

setupminimal avatar Oct 04 '17 18:10 setupminimal

I would like to work on this in java.

anshul98ks123 avatar Oct 05 '17 09:10 anshul98ks123

I have added PR on edit distance in java. Please review it.

anshul98ks123 avatar Oct 05 '17 17:10 anshul98ks123

@AdiChat, We have another version of edit distance which is space efficient version used to align dna sequences, as they are very large so we can not use just O(mn) space (m, n- length of two strings), so I want to add code in C++ of O(2*m) space, also in both versions of code I want to like to add backtracking part, means finally what are aligned sequences are? Please assign me this work. Please assign it under hacktoberfest.

amankh99 avatar Oct 14 '17 08:10 amankh99

Yes, @amankh99 Go ahead and make a pull request 👍

AdiChat avatar Oct 14 '17 10:10 AdiChat

Please review the pull request and suggest any changes.

amankh99 avatar Oct 14 '17 16:10 amankh99

@AdiChat , For adding backtracking part means getting the aligned sequences in edit_distance problem having O(m*n) space complexity (m, n - length of strings) should I make a new file or should modify the existing file made by Vitorvgc.

amankh99 avatar Oct 15 '17 08:10 amankh99

@AdiChat , Please review this backtracking part of edit distance of O(m*n) space complexity - pull request

amankh99 avatar Oct 17 '17 13:10 amankh99