How to Create Deque of Unordered_Set in C++?
In C++, a deque (double-ended queue) is a container that allows insertion and removal of elements from both ends whereas an unordered set is a container that stores unique elements in no particular order. In this article, we will learn how to create a deque of unordered sets in C++ STL....
read more
Find product of nodes whose weights is catalan number in a Linked list
Given a linked list with weights, the task is to find the product of nodes whose weights are Catalan numbers....
read more
max_bucket_count() Function in Unordered Set C++ STL
Prerequisite: unordered_set() in C++...
read more
Python3 Program to 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 :...
read more
Java Program for 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 to be unique if all of the three numbers in the triplet are unique....
read more
Python3 Program for 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 to be unique if all of the three numbers in the triplet are unique....
read more
Java Program for Maximize elements using another array
Given two arrays with size n, maximize the first array by using the elements from the second array such that the new array formed contains n greatest but unique elements of both the arrays giving the second array priority (All elements of second array appear before first array). The order of appearance of elements is kept same in output as in input.Examples:...
read more
Python3 Program for Maximize elements using another array
Given two arrays with size n, maximize the first array by using the elements from the second array such that the new array formed contains n greatest but unique elements of both the arrays giving the second array priority (All elements of second array appear before first array). The order of appearance of elements is kept same in output as in input.Examples:...
read more
Javascript Program for Maximize elements using another array
Given two arrays with size n, maximize the first array by using the elements from the second array such that the new array formed contains n greatest but unique elements of both the arrays giving the second array priority (All elements of second array appear before first array). The order of appearance of elements is kept same in output as in input.Examples:...
read more
Ternary number system or Base 3 numbers
A number system can be considered as a mathematical notation of numbers using a set of digits or symbols. In simpler words, the number system is a method of representing numbers. Every number system is identified with the help of its base or radix....
read more
StringStream in C++ for Decimal to Hexadecimal and back
Stringstream is stream class present in C++ which is used for doing operations on a string. It can be used for formatting/parsing/converting a string to number/char etc. Hex is an I/O manipulator that takes reference to an I/O stream as parameter and returns reference to the stream after manipulation. Here is a quick way to convert any decimal to hexadecimal using stringstream:...
read more
Working and Examples of bind () in C++ STL
In C++, the std::bind function is a part of the Standard Template Library (STL) and it is used to bind a function or a member function to a specific object or value. It creates a new function object by “binding” a function or member function to a specific object or value, allowing it to be called with a different number of arguments or with a different order of arguments....
read more