Skip to content

Tag Archives: cpp-algorithm-library

std :: move Moves the elements in the range [first,last] into the range beginning at result. The value of the elements in the [first,last] is… Read More
std::remove : It doesn’t actually delete elements from the container but only shunts non-deleted elements forwards on top of deleted elements. vector::erase : Removes from… Read More
std :: find_if Returns an iterator to the first element in the range [first, last] for which pred(Unary Function) returns true. If no such element… Read More
std::count() returns number of occurrences of an element in a given range. Returns the number of elements in the range [first,last) that compare equal to… Read More
std :: remove It is defined in <algorithm> library. It removes value from range. Transforms the range [first,last) into a range with all the elements… Read More
The function is defined in header <algorithm>. It rotates the order of the elements in the range [first,last], in such a way that the element… Read More
The C++ function is defined in <algorithm> library in STL. This function operates on whole range of array elements and can save time to run… Read More
std::replace Assigns new_value to all the elements in the range [first, last) that compare to old_value. The function use operator == to compare the individual… Read More
The C++ function std :: is_sorted checks if the elements in range [first, last] are sorted in ascending order. Elements are compared using < operator. There… Read More
Searches the range [first, last) for the first occurrence of two consecutive elements that match, and returns an iterator to the first of these two… Read More
C++ program to merge two sorted arrays of length ‘n’ and ‘m’ respectively in sorted order. Examples: Input : A[] = {3, 6, 9} B[]… Read More
Apart from the generic looping techniques, such as “for, while and do-while”, C++ in its language also allows us to use another functionality which solves… Read More
The C++ function std::algorithm::is_permutation() tests whether a sequence is permutation of other or not. It uses operator == for comparison. This function was defined in… Read More
Various varieties of copy() exist in C++ STL that allows to perform the copy operations in different manners, all of them having their own use.… Read More
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