## Reverse a Doubly Linked List

In this post, we will see how to reverse a doubly linked list using iteration and recursion.

## Construct a full binary tree from a preorder and postorder sequence

A full binary tree is a tree in which every node has either 0 or 2 children. Write an efficient algorithm to construct a full binary tree from given preorder and postorder sequence.

## Find number of ways to fill a N x 4 matrix with 1 x 4 tiles

Given a n x 4 matrix where n is a positive number, find number of ways to fill the matrix with 1 x 4 tiles.

## Find index that divides an array into two non-empty subarrays of equal sum

Given an array of integers, find an index that divides the array into two non-empty subarrays having equal sum.

Given a linked list, pairwise swap its adjacent nodes. The swapping of data is not allowed, only links should be changed.

## Depth first search (DFS) vs Breadth first search (BFS)

In this post, we will see the difference between Depth first search (DFS) and Breadth first search (BFS) algorithm which are used to traverse/search tree or graph data structure.

## Implement two stacks in a single array

In this post, we will discuss how to efficiently implement two stacks in a single array.

## Count subtrees in a BST whose nodes lies within a given range

Given a BST, count subtrees in it whose nodes lies within a given range.   For example, consider below BST. The number of subtrees with nodes in the range [5, 20] are 6.

Given a linked list which can grow in both horizontal and vertical directions (right and down), flatten it into a sorted singly linked list provided that each horizontal and vertical list is already sorted.

## Find total ways to reach the n’th stair from the bottom

Given a stair case, find total number of ways to reach the n’th stair from bottom of the stair when a person is only allowed to climb either 1 or 2 or 3 stairs at a time.

## Find the correct order of alphabets in a given dictionary of ancient origin

Given a dictionary of ancient origin where the words are arranged alphabetically, find the correct order of alphabets in the ancient language.

## Construct a Cartesian Tree from In-order Traversal

Write an efficient algorithm to construct a Cartesian tree from in-order traversal. A Cartesian tree is a binary tree with the heap property: the parent of any node has smaller value than the node itself.