Skip to content

Tag Archives: cpp-algorithm-library

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
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
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
reverse() is a predefined function in header file algorithm. It is defined as a template in the above mentioned header file. It reverses the order… Read More
Binary search is an important component in competitive programming or any algorithmic competition, having knowledge of shorthand functions reduces the time to code them. This… Read More
Some of the merge operation classes are provided in C++ STL under the header file “algorithm”, which facilitates several merge operations in a easy manner.… Read More
C++ has a class in its STL algorithms library which allows us easy partition algorithms using certain inbuilt functions. Partition refers to act of dividing… Read More
From C++11 onwards, some new and interesting algorithms are added in STL of C++. These algorithms operate on an array and are useful in saving… Read More
In case of arrays, there is no much choice to copy an array into other, other than iterative method i.e running a loop to copy… Read More
For all those who aspire to excel in competitive programming, only having a knowledge about containers of STL is of less use till one is… Read More
Prerequisite – Vector Basics Following are some important points that can save time on little things in an interview or an important coding contest. vector… Read More
Consider the problem of adding contents of two arrays into a third array. It is given that all arrays are of same size.Following is simple… Read More
We have discussed qsort() in C. C++ STL provides a similar function sort that sorts a vector or array (items with random access).  It generally… Read More
Sorting is one of the most basic functions applied to data. It means arranging the data in a particular fashion, which can be increasing or… Read More
Binary search is a widely used searching algorithm that requires the array to be sorted before search is applied. The main idea behind this algorithm… Read More