Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dynamic_programming/edit_distance_space_efficient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ using namespace std;
//cost associated
int cost = 0;

//Below are the functions which are returning costs involved according to operation done in aligning strings
//These are arbitrary costs

//insertion cost
inline int insC() {
return 4;
Expand All @@ -22,9 +25,9 @@ inline int delC() {

//modification cost
inline int modC(char fr, char to) {
if(fr == to)
if(fr == to) //if both characters are equal
return 0;
return 3;
return 3; //if both characters are not equal
}

//reversing the string
Expand Down