c++ recursive , memoization and tabulation Method
Recursive \n\nclass Solution {\npublic:\n    \n    int editDis(string& word1, string& word2, int n1, int n2)\n    {\n        if(n1 == 0)\n            return n2;
Recursive \n```\nclass Solution {\npublic:\n    \n    int editDis(string& word1, string& word2, int n1, int n2)\n    {\n        if(n1 == 0)\n            return n2;\n        if(n2 == 0)\n            return n1;\n       // cout<<n1<<" "<<n2<<endl;\n        if(word1[n1-1] == word2[n2-1]) {\n            return editDis(word1, word2, n1-1, n2-1);\n        }\n            \n        return 1+min(editDis(word1, word2, n1, n2-1),\n                  min(editDis(word1, word2, n1-1, n2),\n                  editDis(word1, word2, n1-1, n2-1)));\n    }\n    \n    int minDistance(string word1, string word2) {\n        int n1 = word1.size();\n        int n2 = word2.size();\n        return editDis(word1, word2, n1, n2);\n        \n    }\n};\n```\nMemoization:\n```\nclass Solution {\npublic:\n    int dp[1001][1001];\n    \n    int editDis(string& word1, string& word2, int n1, int n2)\n    {\n        if(n1 == 0)\n            return n2;\n        if(n2 == 0)\n            return n1;\n       // cout<<n1<<" "<<n2<<endl;\n        if(dp[n1][n2] !=-1)\n        {\n            return dp[n1][n2];\n        }\n        if(word1[n1-1] == word2[n2-1]) {\n            dp[n1][n2] = editDis(word1, word2, n1-1, n2-1);\n            return dp[n1][n2];\n        }\n            \n        dp[n1][n2]=  1+min(editDis(word1, word2, n1, n2-1),\n                  min(editDis(word1, word2, n1-1, n2),\n                  editDis(word1, word2, n1-1, n2-1)));\n        return dp[n1][n2];\n    }\n    \n    int minDistance(string word1, string word2) {\n        int n1 = word1.size();\n        int n2 = word2.size();\n        for(int i=0;i<=n1+1;i++)\n        {\n            for(int j=0;j<=n2+1;j++)\n            {\n                dp[i][j] = -1;\n            }\n        }\n        dp[n1][n2] = editDis(word1, word2, n1, n2);\n        return dp[n1][n2];\n        \n    }\n};\n```\n\nTabulation\n```\nclass Solution {\npublic:    \n    int minDistance(string word1, string word2) {\n        int n1 = word1.size();\n        int n2 = word2.size();\n        int dp[n1+2][n2+2];\n        \n        for(int i=0;i<n1+1;i++)\n        {\n             dp[i][0] = i;\n        }\n        \n        for(int i=0;i<n2+1;i++)\n        {\n             dp[0][i] = i;\n        }\n        \n        for(int i=1;i<n1+1;i++)\n        {\n            for(int j=1;j<n2+1;j++)\n            {\n                if(word1[i-1] == word2[j-1])\n                {\n                    dp[i][j] = dp[i-1][j-1];\n                } else {\n                  dp[i][j] = 1+min(dp[i-1][j],min(dp[i][j-1], dp[i-1][j-1]));\n                }\n            }\n        }\n        return dp[n1][n2];\n\n        \n    }\n};\n```\n
['Dynamic Programming', 'Recursion', 'Memoization', 'C']