# Category Archives: Algorithms

Write a program to find sum of positive integers without using any operator. Only use of printf() is allowed. No other library function can be… Read More
Given a partially filled 9×9 2D array ‘grid’, the goal is to assign digits (from 1 to 9) to the empty cells so that every… Read More
The partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets… Read More
Given a positive integer N, the task is to count the total number of set bits in binary representation of all numbers from 1 to… Read More
Given a string, a partitioning of the string is a palindrome partitioning if every substring of the partition is a palindrome. For example, “aba|b|bbabb|a|b|aba” is… Read More
The Floyd Warshall Algorithm is for solving all pairs of shortest-path problems. The problem is to find the 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
There are N people standing in a circle waiting to be executed. The counting out begins at some point in the circle and proceeds around… Read More
Pattern searching is an important problem in computer science. When we do search for a string in a notepad/word file, browser, or database, pattern searching… Read More
Given an array and a value, find if there is a triplet in array whose sum is equal to the given value. If there is… Read More
Given an array of random numbers. Find the longest increasing subsequence (LIS) in the array. I know many of you might have read recursive and dynamic… 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 includes prices of all pieces of size smaller than n. Determine… Read More
Given a sequence, find the length of the longest palindromic subsequence in it.  As another example, if the given sequence is “BBABCBCAB”, then the… Read More
Hamiltonian cycle: The Hamiltonian cycle of undirected graph          G <= V , E> is the cycle containing each vertex in V.… Read More