## Find equilibrium index of an array

Given an array of integers, find equilibrium index in it.

## Sort an array containing 0’s, 1’s and 2’s (Dutch national flag problem)

Given an array containing only 0’s, 1’s and 2’s, sort the array in linear time and using constant space.

## Determine if given Binary Tree is a BST or not

Given a Binary Tree, determine if it is a BST or not.   This problem has a simple recursive solution. The BST property “every node on the right subtree has to be larger than the current node and every node on the left subtree has to be smaller than the current node” is the key …

## Find maximum sum root to leaf path in a binary tree

Given a binary tree, write an efficient algorithm to find maximum sum root to leaf path i.e. maximum sum path from root node to any leaf node in it.

## Preorder Tree Traversal | Iterative & Recursive

Given a binary tree, write iterative and recursive solution to traverse the tree using pre-order traversal.   Unlike linked lists, one-dimensional arrays and other linear data structures, which are traversed in linear order, trees may be traversed in multiple ways in depth-first order (pre-order, pre-order and pre-order) or breadth-first order (level order traversal). Beyond these …

## Convert binary tree to its mirror

Given a binary tree, write an efficient algorithm to convert binary tree to its mirror.

## In-place convert given binary tree to its sum tree

Given a binary tree, in-place convert it to its sum tree. In a sum tree, value at each node is equal to the sum of all elements present in its left and right subtree. The value of an empty node is considered as 0.

## Reverse Level Order Traversal of Binary Tree

Given a binary tree, print its nodes level by level in reverse order. i.e. all nodes present at last level should be printed first followed by nodes of second-last level and so on.. All nodes for any level should be printed from left to right.

## Detect Cycle in a linked list (Floyd’s Cycle Detection Algorithm)

Given a linked list, detect cycle in it.

## Find K’th node from the end in a linked list

Given a linked list and a positive integer K, find K’th node from the end in a linked list.

## Reverse every group of k nodes in given linked list

Given a linked list, reverse every adjacent group of k nodes in it where k is given positive integer.

## Reverse linked list | Part 2 (Recursive Solution)

Given a singly list it, reverse it using recursion.

## Reverse linked list | Part 1 (Iterative Solution)

Given a singly linked list it, reverse it.

## Remove duplicates from a sorted linked list

Given a linked list sorted in increasing order, write a function which removes any duplicate nodes from the list by traversing the list only once.