# Tag Archives: cpp-unordered_set

## Print array elements that are divisible by at-least one other

Given an array of length N that contains only integers, the task is to print the special numbers of array. A number in this array… Read More »

## Dynamic Disjoint Set Data Structure for large range values

Prerequisites: Disjoint Set Data Structure Set Unordered_Map Disjoint Set data structure is used to keeps track of a set of elements partitioned into a number… Read More »

## Number of pairs with Pandigital Concatenation

A pair of strings when concatenated is said to be a ‘Pandigital Concatenation’ if their concatenation consists of all digits from (0 – 9) in… Read More »

## Find the only repetitive element between 1 to n-1

We are given an array arr[] of size n. Numbers are from 1 to (n-1) in random order. The array has only one repetitive element.… Read More »

## Print all triplets in sorted array that form AP

Given a sorted array of distinct positive integers, print all triplets that form AP (or Arithmetic Progression) Examples : Input : arr[] = { 2,… Read More »

## Construct a tree from Inorder and Level order traversals | Set 2

Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem. Examples: Input: Two arrays… Read More »

## Number of unique triplets whose XOR is zero

Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said… Read More »

## Check if two BSTs contain same set of elements

Given two Binary Search Trees consisting of unique positive elements, we have to check whether the two BSTs contains same set or elements or not.… Read More »

## Difference between set, multiset, unordered_set, unordered_multiset

1. Set (i) Stores the values in sorted order. (ii) Stores only unique values. (iii) Elements can only be inserted or deleted but cannot be… Read More »

## Unordered Sets in C++ Standard Template Library

An unordered_set is implemented using a hash table where keys are hashed into indices of a hash table so that the insertion is always randomized.… Read More »

## Find if there is a subarray with 0 sum

Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum. Examples : Input: {4,… Read More »