Skip to content

Edit Distance Recursive solution #305

@Syed0208

Description

@Syed0208

Please change the recursive call to find the min by removing the check for same characters and make that condition as a separate one (as it is producing wrong output).

code:

if(str1[len1] == str2[len2])
            return recEditDistance(str1, str2, len1 + 1, len2 + 1);

    return 1 + min(recEditDistance(str1, str2, len1 + 1, len2 + 1),
                recEditDistance(str1, str2, len1, len2 + 1),
                recEditDistance(str1, str2, len1 + 1, len2)); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions