Given a string sorted in descending order, find all lexicographically previous permutations of it.
Given a binary tree, check if it is a min-heap or not. In order words, the binary tree must be a complete binary tree where each node has value is greater than the value of its parent.
Given a linked list of characters, recursively check if it is palindrome or not.
Write an efficient algorithm to construct a binary tree from given inorder and preorder sequence.
Given a binary search tree, find a triplet with given sum present in it.
We have an array of non-negative integers, such that each element in the array represents the maximum number of positions one can move forward from that element.
Given two binary search trees, merge them into a doubly linked list in sorted order.
Given an array consisting of positive and negative integers, segregate them without changing the relative order of elements.
In this post, we will discuss few problems that can easily solved in linear time and constant space by modifying partitioning logic of quicksort algorithm.
Given a binary search tree (BST), convert it into a height-balanced binary search tree. For a height-balanced binary search tree, the difference between the height of the left and right subtree of every node is never more than 1.
Given a linked list which stores a path formed by cells of a matrix, remove the redundant nodes in that path. The path can be both vertical and horizontal, but never diagonal.
Given a binary tree, find the size of the largest BST (Binary Search Tree) in it.