# Tag Archives: STL

## std::minmax() and std::minmax_element() in C++ STLJune 15, 2017

C++ defined functions to get smallest and largest elements among 2 or in a container using different functions. But there are also functions that are… Read More »

## Geometry using Complex Numbers in C++ | Set 2June 14, 2017

After going through previous post, we know what exactly are complex numbers and how we can use them to simulate points in a cartesian plane.… Read More »

## Geometry using Complex Numbers <std::complex> in C++ | Set 1

While solving geometric problems, it is time consuming to define the point class for specifying a point on the 2D Plane or the Euclidean Plane.… Read More »

## std::mismatch() with examples in C++June 13, 2017

C++ STL has lots of useful functions that helps us to achieve various programming tasks. One such function is “mismatch()” . This function, defined in… Read More »

## std::gcd | C++ inbuilt function for finding GCDJune 10, 2017

In many competitive programming problems, we need to find greatest common divisor also known as gcd. Euclids algorithm to find gcd has been discussed here… Read More »

## is_permutation() in C++ and its application for anagram searchJune 4, 2017

is_permutations() is used to check if two containers like string and vector are permutation of each other. It accepts three parameters, the first two parameters… Read More »

## C++ tricks for competitive programming (for C++ 11)June 3, 2017

We have discussed some tricks in below post. In this post, some more tricks are discussed. Writing C/C++ code efficiently in Competitive programming Although practice… Read More »

## How to store Data Triplet in a Vector in C++?June 2, 2017

Given a vector, how can we store 3 elements in one cell of vector. Examples: Input : 2 5 10 3 6 15 Output :… Read More »

## Different ways to delete elements in std::map (erase() and clear())

This article deals with the deletion part of Maps. Using erase() : erase() is used to erase the pair in map mentioned in argument, either… Read More »

## Conversion of whole String to uppercase or lowercase using STL in C++June 1, 2017

Given a string, convert the whole string to uppercase or lowercase using STL in C++. Examples: For uppercase conversion Input : s = “String” Output… Read More »

## Inserting elements in std::map (insert, emplace and operator [])May 30, 2017

Prerequisite : Map in STL Map is a container, as name suggests used to store a key-value pair. Map has an advantage over other containers… Read More »

## Searching in a map using std::map functions in C++May 29, 2017

Usually, main purpose of using map stl container is for efficient search operations and sorted order retrieval. As map stores key-value pair, all the search… Read More »

## How to transform Vector into String?May 25, 2017

Vectors: Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being… Read More »

## Print prime numbers in a given range using C++ STLMay 20, 2017

Generate all prime numbers between two given numbers. The task is to print prime numbers in that range. The Sieve of Eratosthenes is one of… Read More »

## Sort an array of strings according to string lengthsMay 16, 2017

We are given an array of strings, we need to sort the array in increasing order of string lengths. Examples: Input : {“GeeksforGeeeks”, “I”, “from”,… Read More »