## Count of all pairs in an Array with minimum absolute difference

Given an integer array arr[] of size N, the task is to count the total number of distinct pairs having minimum absolute difference. Examples: Input:… Read More »

- Median of sliding window in an array
- Minimum number of swaps required to sort an array of first N number
- Efficiently merging two sorted arrays with O(1) extra space and O(NlogN + MlogM)
- Number of pairs in an array with the sum greater than 0
- Maximum number of unique values in the array after performing given operations
- Search an element in a sorted and rotated array with duplicates
- Sort a string according to the frequency of characters
- Find the K closest points to origin using Priority Queue
- Maximum number of overlapping Intervals
- Find lexicographically smallest string in at most one swaps
- Priority queue of pairs in C++ with ordering by first and second element
- Sorting a Map by value in C++ STL
- Count of smaller elements on right side of each element in an Array using Merge sort
- Count number of pairs with positive sum in an array
- Sort an Array which contain 1 to N values in O(N) using Cycle Sort
- Sort the strings based on the numbers of matchsticks required to represent them
- Sorting Algorithm Visualization : Merge Sort
- Minimum increment or decrement required to sort the array | Top-down Approach
- Check if the given string is shuffled substring of another string
- Longest subarray such that difference of max and min is at-most K
- Sort an Array based on the absolute difference of adjacent elements
- Sort an array of Strings according frequency
- Minimum cost to make an Array a permutation of first N natural numbers
- Maximum Possible Rating of a Coding Contest
- Shortest path in a directed graph by Dijkstra’s algorithm
- When to use each Sorting Algorithm
- Find Non-overlapping intervals among a given set of intervals
- Rank of all elements in a Stream in descending order when they arrive
- Leftmost Column with atleast one 1 in a row-wise sorted binary matrix
- Minimum and Maximum of all subarrays of size K using Map

Given an integer array arr[] of size N, the task is to count the total number of distinct pairs having minimum absolute difference. Examples: Input:… Read More »

Given an array arr[] of N integers, the task is to replace each element of Array with their rank in array. The rank of an… Read More »

Given an arr[] of size N whose elements are sorted in descending order. The task is to find if the given array can be sorted… Read More »

Prerequisites: Graham Scan’s Convex Hull, Orientation. Given a set of N points in a coordinates plane, the task is to find the maximum distance between… Read More »

Given a bitonic array arr[] the task is to sort the given bitonic array. A Bitonic Sequence is a sequence of numbers that is first… Read More »

QuickSort is a popular sorting technique based on divide and conquer algorithm. In this technique, an element is chosen as a pivot and the array… Read More »

Given an array, arr[] of N integers, the task is to rearrange the array elements such that the smallest element is at the 0th position,… Read More »

Given an integer K and an array A[ ] whose length is multiple of K, the task is to split the elements of the given… Read More »

Given an array arr[] and a target value K. The task is to find the minimum number of steps required to take all elements from… Read More »

Given an array arr[] having N integers and an integer K, the task is to select K elements from the given array such that sum… Read More »

Given a matrix mat[][] of size M*N, the task is to sort only the border elements of the matrix in the clockwise direction and print… Read More »

Given n rectangular buildings in a 2-dimensional city, computes the skyline of these buildings, eliminating hidden lines. The main task is to view buildings from… Read More »

Given coordinates of the N points of a Convex Polygon. The task is to check if the given point (X, Y) lies inside the polygon.… Read More »

Given an array interval of pairs of integers representing the starting and ending points of the interval of size N. The task is to find… Read More »

Given a linked list where every node represents a linked list and contains two pointers of its type: Pointer to next node in the main… Read More »