У нас вы можете посмотреть бесплатно DP - 8: Edit Distance (Minimum operations required to transform String - 1 to String - 2) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Source Code:https://thecodingsimplified.com/edit-... Solution - 1: Using recursive solution If last character of both string is matching, then we recursively solve for rest n-1, m-1 characters of strings If it's not matching means, we get the min out of 3 recursive solution, if add (n, m-1), remove (n-1, m) & modify After getting minimum add 1 to it Time Complexity: O(3^n) Space Complexity: O(n*m) Solution - 2: DP Solution (Bottom Up) We initialize 2D array with first string characters are represting row & 2nd string characters represting as column We initialize values for 1st row & 1st column If characters are matching we add a[n-1][m-1] If characters are not matching, we assign 1 + Min(a[n-1][m-1], a[n][m-1], a[n-1][m]); At last we return a[n][m] as answer Time Complexity: O(n * m) Space Complexity: O(n * m) Do Watch video for more info CHECK OUT CODING SIMPLIFIED / codingsimplified ★☆★ VIEW THE BLOG POST: ★☆★ http://thecodingsimplified.com I started my YouTube channel, Coding Simplified, during Dec of 2015. Since then, I've published over 400+ videos. ★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★ https://www.youtube.com/codingsimplif... ★☆★ Send us mail at: ★☆★ Email: thecodingsimplified@gmail.com