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.
Given a singly linked list whose nodes represents digits of a number, add a single-digit number to it.
Given a Directed Acyclic Graph (DAG), print all its topological orderings.
Given a linked list, reverse every alternate group of k nodes in it where k is given positive integer.
In this post, we will see how to implement a stack data structure using queue in C++ and Java. In other words, design a stack that supports push and pop operations using standard enqueue and dequeue operations of the queue.
Given a singly linked list of integers, determine if the linked list is a palindrome or not.
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.
Given an array of distinct integers, shuffle an array according to the given order of elements.
Given a doubly linked list, sort it using merge sort algorithm.
Given a set of activities and the starting & finishing time of each activity, find the maximum number of activities that can be performed by a single person assuming that a person can only work on a single activity at a time.
Given an array A of integers, efficiently find a sorted triplet such that A[i] < A[j] < A[k] and 0 < = i < j < k < n where n is the size of the array.