У нас вы можете посмотреть бесплатно DP - 6: Longest Common Subsequence или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Source Code:https://thecodingsimplified.com/longe... Solution - 1: Recursive Basic Solution We start from last character of both string & check if it's matching then check remaining characters & add 1 It's not matching, then Get the maximum of lcs(n, m-1), lcs(n-1, m) Time Complexity: O(2^n) Space Complexity: O(n * m) Solution - 2: Top Down DP Solution We start from last character of both string & check if it's matching then check remaining characters & add 1 It's not matching, then Get the maximum of lcs(n, m-1), lcs(n-1, m) Now whenever we get any value, we stoe the value, so whenever this will ask again, we're return from 2d array Time Complexity: O(n * m) Space Complexity: O(n * m) Solution - 2: Bottom UP DP Solution We initialize 2D array We start from 1st character of both string & if matching then add 1 + arr[n-1][m-1] It's not matching, then Get the maximum of arr[n][m-1], arr[n-1][m] at last we return arr[n][m] 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