We have discussed Overlapping Subproblems and Optimal Substructure properties.
Let us discuss Longest Increasing Subsequence (LIS) problem as an example problem tha...

Share

We have discussed Overlapping Subproblems and Optimal Substructure properties in Set 1 and Set 2 respectively. We also discussed one example problem in Set 3. Let us...

Share

Given a number as a string, write a function to find the number of substrings (or contiguous subsequences) of the given string which recursively add up to 9.
For exa...

Share

Given an array of random numbers, find longest monotonically increasing subsequence (LIS) in the array.
If you want to understand the O(NlogN) approach, it’s e...

Share

Given two strings str1 and str2, find if str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting some element...

Share

We have discussed Overlapping Subproblems and Optimal Substructure properties in Set 1 and Set 2 respectively. We also discussed one example problem in Set 3. Let us...

Share

Given a string, print the longest repeating subsequence such that the two subsequence don’t have same string character at same position, i.e., any i’th ...

Share

Given an array of n positive integers. Write a program to find the sum of maximum sum subsequence of the given array such that the integers in the subsequence are sor...

Share

Given a non negative array, find the number of subsequences having product smaller than K.
Examples:
Input : [1, 2, 3, 4]
k = 10
Output :11
The subsequences...

Share

We have discussed Overlapping Subproblems and Optimal Substructure properties.
Let us discuss Longest Increasing Subsequence (LIS) problem as an example problem tha...

Share