## C program for odd-even sort or brick sort

Write a C program for odd-even sort or brick sort. An Odd-Even Sort or brick sort is a simple sorting algorithm. In this algorithm we compare all odd/even indexed...

## what is power set explain with example

what is power set explain it with example? Let me ask one question. What is set? Answer is “a set is collection of distinct objects”. Now let us define...

## 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. Min 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}...

## c program to check line segment intersection

write a c program to check line segment intersection. we have already discussed the line segment intersection theory on our previous post http://wikistack.com/line-segment-intersection/. Now we know how to make...