## std::inner_product in C++

Compute cumulative inner product of range Returns the result of accumulating init with the inner products of the pairs formed by the elements of two… Read More »

Compute cumulative inner product of range Returns the result of accumulating init with the inner products of the pairs formed by the elements of two… Read More »

Union of two sorted ranges The union of two sets is formed by the elements that are present in either one of the sets, or… Read More »

The difference of two sets is formed by the elements that are present in the first set, but not in the second one. The elements… Read More »

The intersection of two sets is formed only by the elements that are present in both sets. The elements copied by the function come always… Read More »

make_heap() is used to transform a sequence into a heap. A heap is a data structure which points to highest( or lowest) element and making… Read More »

You are given a string, find its rank among all its permutations sorted exicographically. Examples: Input : str[] = “acb” Output : Rank = 2… Read More »

Basics of Binary Search std::bsearch searches for an element in a sorted array. Finds an element equal to element pointed to by key in an… Read More »

Clamps a variable to a given range[high – low]. If num > high, num is assigned high. If num < low, num is assigned low.… Read More »

Function object for performing division. Effectively calls operator / on two instances of type T. Syntax : template struct divides : binary_function { T operator()… Read More »

std::partial_sort is used for sorting the range within the entire container. So, if we want to keep the original container intact and just copy the… Read More »

std::sort is used for sorting the elements present within a container. One of the variants of this is std::partial_sort, which is used for sorting not… Read More »

rotate in STL:It rotates the order of the elements in the range [first, last), in such a way that the element pointed by middle becomes… Read More »

std::is_partitioned is used for finding whether the range[first, last) is partitioned or not. A range is said to be partitioned with respect to a condition… Read More »

Parses string interpreting its content as a floating-point number, which is returned as a value of type float. Syntax : float stof (const string& str,… Read More »

std::advance and std::next are used to advance the iterator by a certain position, such that we can make the iterator point to a desired position.… Read More »