## find largest island area using dfs

Given a 2D matrix filled with 0 and 1, where 0 represents water and 1 represents a land. find largest island area using dfs. An island is defined as...

## find longest increasing subsequence using recursion

write a recursive function to find longest increasing subsequence using recursion. For example if we have sequence of { 6, 3, 4, 5, 6, 9, 8 }. The longest...

## Smart Frog codechef problem solution by backtracking

Backtracking problem is not easier to understand. For an average programmer practice is the only way to become an expert at backtracking problem solution. The article “Smart Frog codechef...

## max heap and min heap c program

Max heap and min heap is a complete binary tree with special property. Max Heap, A complete binary tree where each node value is less than or equal to...

## subset sum problem using backtracking

We have discussed the “subset sum problem using dynamic programming” . We can solve subset sum problem using backtracking algorithm. For example if there is set S{ 1,3,9,2} and...

## print combinations of string taken r at a time in c

write a program to print combinations of string taken r at a time in c. According to wikipedia “a combination is a way of selecting items from a collection,...

## permutation of a string using backtracking

write c program for all permutation of a string using backtracking. Permutation means all possible re-arrangements of a collection of objects, where the order is important. for example {a,b,c}...

## line segment intersection

Line segment intersection is classic computer science problem related to computer graphics or computed geometry. Your given two line segments and you need to write c or c++ program...

## maximum submatrix sum problem

Given a 2D matrix find the maximum submatrix sum in it. The matrix is containing positive and negative integers. For example The maximum submatrix sum is 15 in the...

## sieve of eratosthenes

sieve of eratosthenes is one of oldest and efficient algorithm for generating all prime numbers less than or equal to a given number N. For example if given number...