## Check if any interval completely overlaps the other

An interval is represented as a combination of start time and end time. Given a set of intervals, we need to write a program to… Read More »

## Maximum difference between groups of size two

Given an array of even number of elements, form groups of 2 using these array elements such that the difference between the group with highest… Read More »

## Minimum difference between groups of size two

Given an array of even number of elements, form groups of 2 using these array elements such that the difference between the group with highest… Read More »

## Minimum product subset of an array

Given an array a, we have to find minimum product possible with the subset of elements present in the array. The minimum product can be… Read More »

## Lexicographically smallest string obtained after concatenating array

Given n strings, concatenate them in an order that produces the lexicographically smallest possible string. Examples: Input : a[] = [“c”, “cb”, “cba”] Output :… Read More »

## Sorting array using Stacks

Given an array of elements, task is to sort these elements using stack. Prerequisites : Stacks Examples : Input : 8 5 7 1 9… Read More »

## Check if the given permutation is a valid DFS of graph

Given a graph with N nodes numbered from 1 to N and M edges and an array of numbers from 1 to N. Check if… Read More »

## Sort an array which contain 1 to n values

You have given an array which contain 1 to n element, your task is to sort this array in an efficient way and without replace… Read More »

## Maximum sum of absolute difference of an array

Given an array, we need to find the maximum sum of absolute difference of the array elements for a sequence of this array. Examples: Input… Read More »

## Check if linked list is sorted (Iterative and Recursive)

Given a Linked List, task is to check whether the Linked List is sorted in Descending order or not? Examples : Input : 8 ->… Read More »

## Maximum possible difference of two subsets of an array

Given an array of n-integers. Array may contain repetitive elements but the highest frequency of any elements must not exceed two. You have to make… Read More »

## Comparisons involved in Modified Quicksort Using Merge Sort Tree

In QuickSort, ideal situation is when median is always chosen as pivot as this results in minimum time. In this article, Merge Sort Tree is… Read More »

## Print sorted distinct elements of array

Given an array that might contain duplicates, print all distinct elements in sorted order. Examples: Input : 1, 3, 2, 2, 1 Output : 1… Read More »

## PHP | Sort array of strings in natural and standard orders

You are given an array of strings. You have to sort the given array in standard way (case of alphabets matters) as well as natural… Read More »

## Smallest greater elements in whole array

An array is given of n length, and we need to calculate the next greater element for each element in given array. If next greater… Read More »