Skip to content

Tag Archives: cpp-pair

Given an array of pairs A[][] of size N, the task is to find the longest subsequences where the first element is increasing and the… Read More
Given two arrays arr[] and jump[], each of length N, where jump[i] denotes the number of indices by which the ith element in the array… Read More
Given a 2D array segments[][] where each segment is of the form [L, R] representing (X, Y) co-ordinates, the task is to find a segment… Read More
Given an array arr[] consisting of N integers and an integer X, the task is to perform integer division on the array elements by X… Read More
Given two arrays A[ ] and B[ ] consisting of N integers, where Ai denotes the quantity of sweets of the ith type and Bi… Read More
Given a 2D array ranges[][] of size N * 2, with each row representing a range of the form [L, R], the task is to… Read More
In this article, we will discuss the implementation of the lower_bound() and upper_bound() in a list of pairs. lower_bound(): It returns an iterator pointing to… Read More
In this article we will discuss the implementation of the lower_bound() and upper_bound() in an array of pairs. lower_bound(): It returns an iterator pointing to… Read More
Pairs in C++: The pair container is a simple container defined in <utility> header consisting of two data elements or objects. The first element is… Read More
Maps are associative containers that store elements in a mapped fashion. Each element has a key value and a mapped value. No two mapped values… Read More
Prerequisite: set lower_bound() function in C++ STL, set upper_bound() function in C++ STL lower_bound() returns an iterator pointing to the first element in the range… Read More
Prerequisite: map lower_bound() function in C++ STL, map upper_bound() function in C++ STL In this article, we will discuss the implementation of the lower_bound() and… Read More
Priority Queue: Priority queue is the extension of the queue in which elements associated with priority and elements having higher priority is popped first. Priority… Read More
In this article we will discuss the implementation of the lower_bound() and upper_bound() in vector of pairs.  lower_bound(): It returns an iterator pointing to the… Read More
Given two positive numbers N and M, the task is to check whether the given pairs of numbers (N, M) form a Betrothed Numbers or… Read More