Documentation for 0fea073413

This commit is contained in:
github-actions
2022-10-25 21:38:38 +00:00
parent 179526ce7a
commit 54cd9079ad
1772 changed files with 5550 additions and 5247 deletions

View File

@@ -143,7 +143,7 @@ Functions</h2></td></tr>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Implementation of <a href="https://en.wikipedia.org/wiki/Edit_distance" target="_blank">Minimum Edit Distance</a> using Dynamic Programing. </p>
<p >Given two strings str1 &amp; str2 and we have to calculate the minimum number of operations (Insert, Remove, Replace) required to convert str1 to str2.</p>
<h3><a class="anchor" id="autotoc_md71"></a>
<h3><a class="anchor" id="autotoc_md72"></a>
Algorithm</h3>
<p >We will solve this problem using Naive recursion. But as we are approaching with a DP solution. So, we will take a DP array to store the solution of all sub-problems so that we don't have to perform recursion again and again. Now to solve the problem, We can traverse all characters from either right side of the strings or left side. Suppose we will do it from the right side. So, there are two possibilities for every pair of characters being traversed.</p><ol type="1">
<li>If the last characters of two strings are the same, Ignore the characters and get the count for the remaining string. So, we get the solution for lengths m-1 and n-1 in a DP array.</li>