Longest repeating subsequence : master the art of dynamic programming

Опубликовано: 11 Ноябрь 2020
на канале: Joey'sTech
596
26

This video will throw light on solving the longest repeating subsequence using dynamic programming technique.
The longest repeating subsequence problem will act as the next step in becoming an expert at solving dynamic programming problems.

I am sure you know by now after watching so many videos of Joey'sTech how dynamic programming works. It is a bottom up approach which hits first on the lowest sub-problem.
The approach to this problem is no different and will start from the lowest sub-problem. Let's first check out what the problem statement of the subsequence problem says.

There is a string given to you

'AAYFYDSS'

All you need to do is to find out the longest repeating subsequence which is going to be 'AYS' in this case. As you can see that there are two occurrences of AYS in the string.
Remember that we are finding a subsequence and not a substring. A subsequence can or cannot be a substring but a substring can't be a subsequence.
A subsequence is a sequence of characters which may or may not be contiguous.

Now, I draw the inspiration to solve this DP problem from the longest common subsequence. In this problem of LCS, there are two strings out of which we need to find out the longest
common subsequence. Based on the approach followed in this DP problems, we replicate one more instance of the given string. Now one instance is going to form the rows, and another is going to
form the columns.

This concept of two strings can also be related to the fact that we are going to find two subsequences even though they are the same.

I recommend you to watch this video till the end and then watch the video of the longest common subsequence problem of Joey'sTech to get a good grip on these types of DP problems.
I am very confident that you will feel confident in dynamic programming after watching these videos and solving the problems all by yourself.

The link to the longest common subsequence using dynamic programming has been provided below -
   • Longest Common Subsequence Dynamic Pr...  


Смотрите видео Longest repeating subsequence : master the art of dynamic programming онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Joey'sTech 11 Ноябрь 2020. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 596 раз и оно понравилось 26 посетителям.