## How to create an unordered_map of pairs in C++?

Unordered Map does not contains a hash function for a pair, So if we want to hash a pair then we have to explicitly provide… Read More »

- Merge k sorted arrays | Set 2 (Different Sized Arrays)
- Priority queue of pairs in C++ (Ordered by first)
- Minimum number of swaps required to sort an array | Set 2
- Count number of triplets with product equal to given number with duplicates allowed | Set-2
- Longest subarray having average greater than or equal to x
- Sets of pairs in C++
- Print all pairs in an unsorted array with equal sum
- Print Minimum of all Subarrays using set in C++ STL
- Perform the given queries on the rooted tree
- How to create an unordered_map of pairs in C++?
- Find the missing elements from 1 to M in given N ranges | Set-2
- Sum of minimum difference between consecutive elements of an array
- Check if a king can move a valid move or not when N nights are there in a modified chessboard

Unordered Map does not contains a hash function for a pair, So if we want to hash a pair then we have to explicitly provide… Read More »

Given an integer and ranges (e.g. [a, b]) which are intersecting and overlapping. The task is to find all the number within the range that… Read More »

Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum. Note: Print the result in… Read More »

Given an array of size N and an integer K, find the minimum for each and every contiguous subarray of size K. Examples: Input :… Read More »

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

Given an infinite chessboard with the same rules as that of chess. Also given are N knights coordinates on the infinite chessboard(-10^9 <= x, y… Read More »

Given an array of N distinct elements, find the minimum number of swaps required to sort the array. Note: The problem is not asking to… Read More »

Given an array of positive integers(may contain duplicates) and a number ‘m’, find the number of unordered triplets ((Ai, Aj, Ak) and (Aj, Ai, Ak)… Read More »

Given an array of integers and an integer x. Find length of maximum size subarray having average of integers greater than or equal to x.… Read More »

In C++, priority_queue implements heap. Below are some examples of creating priority queue of pair type. Max Priority queue (Or Max heap) ordered by first… Read More »

Given an array of pairs where each pair represents a range, the task is to find the sum of the minimum difference between the consecutive… Read More »

Given k sorted arrays of possibly different sizes, merge them and print the sorted output. Examples: Input: k = 3 arr[][] = { {1, 3},… Read More »

Least Frequently Used (LFU) is a caching algorithm in which the least frequently used cache block is removed whenever the cache is overflowed. In LFU… Read More »

Given two arrays arr1[] and arr2[] sorted in ascending order and an integer K. The task is to find k pairs with smallest sums such… Read More »