Pinterest • The world’s catalogue of ideas

How many structurally unique binary search trees(BSTs) are possible that store 'n' distinct values? This algorithm uses dynamic programming memoization approach to solve this problem. Here is a video that explains the algorithm with examples and animation.

1

Find the longest monotonically increasing subsequence in an array. Java solution for finding length of longest increasing subsequence in an array is provided in code snippet section. Java visualization is provided in algorithm visualization section.

Using a KMP's preprocessing find out shortest palindrome. The algorithm is explained with the help of examples and animations. Java code is provided in Code Snippet Section.

Detect if a subset from a given set of N non-negative integers sums upto a given value S.

Using dynamic programming find longest palindromic subsequence for a string S. Here is a video solution that finds the longest palindromic subsequence. The algorithm is explained with the help of examples and animations.Java code is provided in Code Snippet Section.

Dynamic Programming solution for longest common substring problem The algorithm is explained with the help of examples and animations.Java code is provided in Code Snippet Section.

Linear solution for longest increasing subsequence problem - O(n logn). The algorithm is explained with the help of examples and animations. Java code is provided in Code Snippet Section.

Use dynamic programming and find the longest common subsequence between strings S1 and S2. Here is a video solution that implements solution for the longest common subsequence problem. The algorithm is explained with the help of examples and animations.Java code is provided in Code Snippet Section.

Solution for finding out maximum number of As possible using given four keys - here is a tutorial with video that explains the dynamic programming approach with the proof of correctness.

Given a gold mine of n*m dimensions. Each field in this mine contains an integer which is the amount of gold in tons. Initially the miner is in first column but can be at any row i. He can move only (right , right up , right down ) that is from a given cell, the miner can move to the cell diagonally up towards the right or right or diagonally down towards the right. Find out maximum amount of gold he can collect. Java code is given in code snippet section.