## set vs unordered_set in C++ STL

Pre-requisite : set in C++, unordered_set in C++ Differences : | set | unordered_set ——————————————————— Ordering | increasing order | no ordering | (by default)… Read More »

- Count number of triplets with product equal to given number with duplicates allowed | Set-2
- Sets of pairs in C++
- How to delete last element from a set in C++
- Subarray whose sum is closest to K
- Maximum value of XOR among all triplets of an array
- Print Minimum of all Subarrays using set in C++ STL
- Smallest Greater Element on Right Side
- Queries to add, remove and return the difference of maximum and minimum.
- Maximum of all Subarrays of size k using set in C++ STL
- Find Maximum and Minimum element in a Set in C++ STL
- Smallest Greater (than S) String of length K whose letters are subset of S
- Longest subarray with only one value greater than k
- Closest greater or same value on left side for every element in array
- Count pairs from two arrays whose modulo operation yields K
- Minimum Numbers of cells that are connected with the smallest path between 3 given cells
- Print all integers that are sum of powers of two given numbers
- How to traverse a C++ set in reverse direction
- set get_allocator() in C++ STL
- set operator= in C++ STL
- Minimum array elements to be changed to make it a Lucas Sequence
- How to delete an element from the Set by passing its value in C++
- How to delete a range of values from the Set using Iterator
- Queries on insertion of an element in a Bitonic Sequence
- Queries to insert, delete one occurrence of a number and print the least and most frequent element

Pre-requisite : set in C++, unordered_set in C++ Differences : | set | unordered_set ——————————————————— Ordering | increasing order | no ordering | (by default)… Read More »

set and map in STL are similar in the sense that they both use Red Black Tree (A self balancing BST). Note that the time… Read More »

Prerequisite :Basic knowledge of STL and Sets Data structure. About ordered set Ordered set is a policy based data structure in g++ that keeps the… Read More »

Write a function to count number of smaller elements on right of each element in an array. Given an unsorted array arr[] of distinct integers,… Read More »

Given a set of N elements such that N, task is to generate an array such that the GCD of any subset of the generated… Read More »

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

Given two integers L and R. Find the number of perfect powers in the given range [L, R]. A number x is said to be… Read More »

The C++ STL set is a data structure used to store the distinct value in ascending or descending order. By default, we can use it… Read More »

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 »

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 »

Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure… Read More »

Assign value by a pair of {} to a container [sourcecode language=”CPP”] // Lots of programmers write code // like this one: pair<int, int> p… Read More »

Given a tree, print the level order traversal in sorted order. Examples : Input : 7 / \ 6 5 / \ / \ 4… 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 »