Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Arrays Backtracking Hash

Given an array A[] and a number x, check for pair in A[] with sum as x

Write a program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in S whose sum is exactly x. ...
Searching Sorting Amazon

Find a pair with the given difference

Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: Input: arr[] = {5, 20, 3, 2, 50, 80}, n...
C C++ CPP-Functions

std::tuple, std::pair Returning multiple values from a function using Tuple and Pair in C++

There can be some instances where you need to return multiple values (may be of different data types ) while solving a problem. One method to do the same is by using ...
C++ cpp-containers-library cpp-pair

Pair in C++ Standard Template Library (STL)

The pair container is a simple container defined in <utility> header consisting of two data elements or objects. The first element is referenced as ‘fi...
Dynamic Programming Greedy Amazon

Maximum Length Chain of Pairs DP-20

You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. A pair (c, d) can follow another pair (a, b) if b < c. ...
C++ cpp-pair STL

Map of pairs in STL

Map in STL is used to hash key and value. We generally see map being used for standard data types. We can also use map for pairs. For example consider a simple proble...
C C++ Sorting

Sorting Vector of Pairs in C++ Set 2 (Sort in descending order by first and second)

We have discussed some of the cases of sorting vector of pairs in below set 1. Sorting Vector of Pairs in C++ | Set 1 (Sort by first and second) More cases are discus...
C C++ Sorting

Sorting Vector of Pairs in C++ Set 1 (Sort by first and second)

What is Vector of Pairs? A pair is a container which stores two values mapped to each other, and a vector containing multiple number of such pairs is called a vector ...
Java Java-Functions Java-KeyPairGenerator

KeyPairGenerator genKeyPair() method in Java with Examples KeyPairGenerator generateKeyPair() method in Java with Examples KeyPairGenerator getInstance() method in Java with Examples KeyPairGenerator getProvider() method in Ja

The genKeyPair() method of java.security.KeyPairGenerator class is used to generate a key pair. If this KeyPairGenerator has not been initialized expli...
Java JavaTuples Java

Pair Class in JavaTuples

A Pair is a Tuple from JavaTuples library that deals with 2 elements. Since this Pair is a generic class, it can hold any type of value in it. Since Pair is a Tuple, ...

Subscribe to Our Newsletter