OpenGenus / cosmos

World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
http://internship.opengenus.org
GNU General Public License v3.0
13.58k stars 3.69k forks source link

Add edit distance solution #181

Open Vitorvgc opened 7 years ago

Vitorvgc commented 7 years ago

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 commented 7 years ago

Added the first implementation in C++: #180

rahulg963 commented 7 years ago

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

AdiChat commented 7 years ago

@rahulg963 Go for it 👍

NishantTanwar commented 7 years ago

I would go for C version. Please assign @AdiChat

AdiChat commented 7 years ago

Go ahead 👍

I have send you an invite

NishantTanwar commented 7 years ago

@AdiChat please review #233 I have added

NishantTanwar commented 7 years ago

Issue #181 Added #233 pls review.

setupminimal commented 7 years ago

I am about to add an implementation in Haskell.

anshul98ks123 commented 7 years ago

I would like to work on this in java.

anshul98ks123 commented 7 years ago

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

amankh99 commented 7 years ago

@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.

AdiChat commented 7 years ago

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

amankh99 commented 7 years ago

Please review the pull request and suggest any changes.

amankh99 commented 7 years ago

@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 commented 7 years ago

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