## Pots of Gold Game – Dynamic Programming

Two-player X and Y are playing Pots of Gold Game where pots of gold arranged in a  line, each containing some gold coins. Both players…

## Tower of Hanoi

Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. It consists of three rods and several disks of different…

## Minimum cost to reach destination – Dynamic Programming

Give n*n matrix find minimum cost required to reach from source to destination. Lets consider source is Array  and destination is Array [n-1][ n-1]…

## Edit Distance Problem (Levenshtein distance) – Dynamic Programming

There are two strings source and destination. The goal of the problem is to convert source to destination by applying minimum edit operations on string…

## Longest Increasing Subsequence Problem – Dynamic Programming

Given an array find a subsequence of a given array in which the array’s elements are in sorted order, lowest to highest, and in which…

## Fibonacci Numbers Problem – Dynamic Programming

Find nth fibonacci number. The Fibonacci Sequence is the series of numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, … The next…

## Rod Cutting Problem – Dynamic Programming

Given a rod of size n and values of various sizes of rod. The problem is to cut the rod in such a way that…

## Subset Sum Problem – Dynamic Programming

Given a set of positive integers and a value sum write program to determine if there is a subset of the given set with sum…

## Sum of all sub arrays in O(n) Time

Given an array write C# program to find the sum of all the possible sub-arrays. For.e.g. int [] a = {4, 2, 1}; Output: Possible…

## Knapsack Problem

The knapsack problem is a problem in combinatorial optimization: Given a set of items, each with a weight and a value, determine the number of…