Given a Binary Tree, find size of the Largest Independent Set(LIS) in it. A subset of all tree nodes is an independent set if there… Read More »
Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given… Read More »
Given a sorted array keys[0.. n-1] of search keys and an array freq[0.. n-1] of frequency counts, where freq[i] is the number of searches to… Read More »
Given a graph and a source vertex src in graph, find shortest paths from src to all vertices in the given graph. The graph may… Read More »
Given a string, find the longest substring which is palindrome. For example, if the given string is “forgeeksskeegfor”, the output should be “geeksskeeg”.
You are given a set of n types of rectangular 3-D boxes, where the i^th box has height h(i), width w(i) and depth d(i) (all… Read More »
We have discussed Dynamic Programming solution for Longest Increasing Subsequence problem in this post and a O(nLogn) solution in this post.
You are given n pairs of numbers. In every pair, the first number is always smaller than the second number.
Given a sequence of words, and a limit on the number of characters that can be put in one line (line width). Put line breaks… Read More »
Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is… Read More »
Given a string, a partitioning of the string is a palindrome partitioning if every substring of the partition is a palindrome.
The Floyd Warshall Algorithm is for solving the All Pairs Shortest Path problem. The problem is to find shortest distances between every pair of vertices… Read More »
Given an array arr[0 … n-1] containing n positive integers, a subsequence of arr is called Bitonic if it is first increasing, then decreasing. Write… Read More »
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… Read More »
Given a rod of length n inches and an array of prices that contains prices of all pieces of size smaller than n.