Given an unsorted array of integers, print all elements which are greater than all elements present to its right.
Write an efficient algorithm to construct a binary tree from given inorder and postorder traversals.
Given an array, count the number of strictly increasing sub-arrays in it.
Given a limited range array of size n where array contains elements between 1 to n+1 with one element missing, find the missing number without using any extra space.
Write an efficient code to clone a linked list with each node containing an additional random pointer. The random pointer can point to any random node of the linked list or null.
Given a binary search tree (BST), efficiently convert it into a min heap. In order words, convert a binary search tree into a complete binary tree where each node has value is greater than the value of its parent.
Given a N x N matrix where each cell of the matrix (i, j) indicates the cost of the direct flight from city i to city j. Find the minimum cost to reach the destination city N-1 from the source city 0.
Given a binary tree, convert it into a doubly linked list following the spiral order.
In this post, we will explore about threaded binary tree and see how to convert a normal binary tree to threaded binary tree.
Given a M x N matrix of integers whose each cell can contain a negative, zero or positive value, determine the minimum number of passes required to convert all negative values in the matrix to positive.
Write an efficient code to clone a binary tree with each node containing an additional random pointer. The random pointer can point to any random node of the binary tree or can be null.
Given a string sorted in descending order, find all lexicographically previous permutations of it.