## Construct a full binary tree from preorder sequence with leaf node information

Write an efficient algorithm to construct a full binary tree from a sequence of keys representing preorder traversal, and a boolean array which determines if the corresponding key in the preorder traversal is a leaf node or an internal node.

## 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.

## 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.

## 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.

## Set next pointer to inorder successor of all nodes in binary tree

Given a binary tree where each node has one extra pointer next, set next pointer to inorder successor for all nodes in the binary tree.

## Efficiently print all nodes between two given levels in a binary tree

Given a binary tree, efficiently print all nodes between two given levels in a binary tree. The nodes for any level should be printed from left to right.

## Find the difference between sum of all nodes present at odd and even levels in a binary tree

Given a binary tree, calculate the difference between sum of all nodes present at odd levels and sum of all nodes present at even level.

## Print nodes of a given binary tree in vertical order

Given a binary tree, print its nodes in vertical order. Assume that the left and right child of a node makes 45 degree angle with the parent.

## Link nodes present in each level of a binary tree in the form of a linked list

Given a binary tree, write an efficient algorithm to link nodes at the same level in the form of a linked list like structure.

## Implementation of Treap Data Structure (Insert, Search and Delete)

In this post, we will implement Treap Data Structure and perform basic operations like insert, search and delete on it.

## Find preorder traversal of a binary tree from its inorder and postorder sequence

Write an efficient algorithm to find preorder traversal of a binary tree from its inorder and postorder sequence without constructing the tree.

## 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.