## Design a stack which returns minimum element in constant time

Design a stack to support an additional operation which returns the minimum element from the stack in constant time. The stack should continue supporting all other operations like push, pop, top, size, empty, etc, with no degrade in performance for these operations.

Given a multilevel linked list, convert it into a singly linked list in such a way that all nodes of first level appears first, followed by all nodes of second level, and so on. The multilevel linked list is similar to the simple linked list except that it has one extra field which points to …

## Rearrange the array such that it contains positive and negative numbers at alternate positions

Given an array of integers, rearrange the array such that it contains positive and negative numbers at alternate positions. If array contains more positive or negative elements, they should be moved to end of the array.

## Find total ways to achieve given sum with n throws of dice having k faces

Calculate total number of ways to achieve given sum with n throws of dice having k faces.

## Update every key in BST to contain sum of all greater keys

Given a binary search tree, modify it such that every key is updated to contain sum of all greater keys present in BST.

## Least cost path in given digraph from given source to destination having exactly m edges

Given a weighted digraph (Directed Graph), find the least cost path from given source to destination that have exactly m edges.

## Find first non-repeating character in a string by doing only one traversal of it

Given a string, find first non-repeating character in it by doing only one traversal of it.

## Fix a binary tree that is only one swap away from becoming a BST

Given a binary tree that is only one swap away from becoming a BST, convert the binary tree into BST in single traversal of it.

## Find maximum sum path between two leaves in a binary tree

Given a binary tree, write an efficient algorithm to find maximum sum path between any two leaves in it.

## Find index of the row containing maximum number of 1’s in a binary matrix

Given a binary M x N row-wise sorted matrix, find a row which contains maximum number of 1 in linear time.

## Calculate frequency of all elements present in an array of specified range in linear time and using constant space

Given an unsorted array of integers whose each element lies in range 0 to n-1 where n is the size of the array, calculate the frequency of all elements present in the array in linear time and using constant space.

## In-place remove all adjacent duplicates from the given string

Given a string, in-place remove all adjacent duplicates from it. The algorithm should continue removing adjacent duplicates from the string till no duplicate is present in the result.