Given an array of positive and negative numbers, find if there is a subarray (of size at-least one) with 0 sum....
Given an array arr[] and an integer k, we need to print k maximum elements of given array. The elements should printed in the order of the input.Note : k is always less than or equal to n....
The problem is opposite of this post. We are given a stack data structure with push and pop operations, the task is to implement a queue using instances of stack data structure and operations on them....
In C++ STL, a map is a container that stores key-value pairs in an ordered or sorted manner. In this article, we will learn how to find the first key-value pair in a Map....
In C++, sets are a type of associative container in which each element has to be unique because the value of the element identifies it. The values are stored in a specific sorted order i.e. either ascending or descending. In this article, we will learn how to find the last element in a set in C++....
In C++, a set is a container that stores unique elements following a specific order. In this article, we will learn how to find the first element in a set....
Given a number N, the task is to find the Nth number which has an absolute difference of 1 between every pair of its adjacent digits.Examples:...
Given an array, the task is to print or display all the reverse permutations of this array using STL in C++. Reverse permutation means, for an array {1, 2, 3}:...
The std::is_floating_point template of C++ STL is used to check whether the given type is a floating point value or not. It returns a boolean value showing the same....
The forward_list::assign() is a function in C++ STL which assigns new content to a forward list, replacing its current content and adjusting its size as required.Syntax:...
The deque::rend() is an inbuilt function in C++ STL which returns a reverse iterator which points to the position before the beginning of the deque (which is considered its reverse end)....
The iswspace() is a built-in function in C/C++ which checks if the given wide character is a wide whitespace character or not. It is defined within the cwctype header file of C++. Syntax:...