## K-Partition Problem | Printing all Partitions

In k-partition problem, we need to partition an array of positive integers into k disjoint subsets that all have equal sum and they completely covers the set.

## 3 Partition Problem

3-partition problem: Given a set S of positive integers, determine if it can be partitioned into three disjoint subsets that all have same sum and they cover S.

## Iterative Merge Sort Algorithm (Bottom-up Merge Sort)

In this post, we will see how to sort an array of integers using iterative merge sort algorithm.

## Build Binary Tree from given Parent array

Given an array A which represents a binary tree such that the parent-child relationship is defined by (A[i], i) for every index i in the array A, build binary tree out of it. The value of root node will be i if -1 is present at index i in the array. It may be assumed …

## Rearrange array such that A[A[i]] is set to i for every element A[i]

Given an unsorted array of integers whose each element lies in range 0 to n-1 where n is the size of the array, rearrange array such that A[A[i]] is set to i for every element A[i] in the array. Do this in linear time and without using any extra constant space.

## Find two odd occurring element in an array without using any extra space

Given an array of integers, duplicates appear in it even number of times except two elements which appears odd number of times. Find both odd appearing element without using any extra memory.

## Find all N-digit binary numbers having more 1’s than 0’s for any prefix

Given a positive integer N, find all N-digit binary numbers having more 1’s than 0’s for any prefix of the number.

## Word Break Problem | Using Trie Data Structure

Given a string and a dictionary of words, determine if string can be segmented into a space-separated sequence of one or more dictionary words.

## Total possible solutions to linear equation of k variables

Given a linear equation of k variables, count total number of possible solutions of it.

## Invert Binary Tree | Recursive and Iterative solution

Given a binary tree, write an efficient algorithm to invert binary tree.

## Swap two bits at given position in an integer

Given an integer, swap two bits at given positions in binary representation of it.

## Convert Min Heap to Max Heap in O(n) time

Given an array representing a Min Heap, convert Min Heap into a Max Heap. The conversion should be done inplace and in linear time.