Algorithm Library Functions in C++ STL Last Updated : 21 Aug, 2025 Suggest changes Share Like Article Like Report Non-modifying sequence operations std :: all_of : Test condition on all elements in rangestd :: any_of : Test if any element in range fulfills conditionstd :: none_of : Test if no elements fulfill conditionstd :: for_each : Apply function to rangestd :: find : Find value in rangestd :: find_if : Find element in rangestd :: find_if_not : Find element in range (negative condition)std :: find_end : Find last subsequence in rangestd :: find_first_of : Find element from set in rangestd :: adjacent_find : Find equal adjacent elements in rangestd :: count : Count appearances of value in rangestd :: count_if : Return number of elements in range satisfying conditionstd :: mismatch : Return first position where two ranges differstd::equal : Test whether the elements in two ranges are equalstd :: is_permutation : Test whether range is permutation of anotherstd :: search : Search range for subsequencestd :: search_n : Search range for elementModifying sequence operations std :: copy : Copy range of elementsstd :: copy_n : Copy elementsstd :: copy_if : Copy certain elements of rangestd :: copy_backward : Copy range of elements backwardstd::move : Move range of elementsstd :: move_backward : Move range of elements backwardstd :: swap : Exchange values of two objectsstd ::swap_ranges : Exchange values of two rangesstd :: iter_swap : Exchange values of objects pointed to by two iteratorsstd ::transform : Transform rangestd ::replace : Replace value in rangestd ::replace_if : Replace values in rangestd :: replace_copy : Copy range replacing valuestd :: replace_copy_if : Copy range replacing valuestd ::fill : Fill range with valuestd :: fill_n : Fill sequence with valuestd ::generate : Generate values for range with functionstd ::generate_n : Generate values for sequence with functionstd ::remove : Remove value from rangestd :: remove_if : Remove elements from rangeremove_copy : Copy range removing valueremove_copy_if : Copy range removing valuesstd ::unique : Remove consecutive duplicates in rangestd :: unique_copy : Copy range removing duplicatesstd ::reverse : Reverse rangestd :: reverse_copy : Copy range reversedstd :: rotate : Rotate left the elements in rangestd :: rotate_copy : Copy range rotated leftstd :: random_shuffle : Randomly rearrange elements in rangestd :: shuffle : Randomly rearrange elements in range using generatorPartition Operations std :: is_partitioned : Test whether range is partitionedstd :: partition : Partition range in twostd :: stable_partition : Partition range in two - stable orderingpartition_copy : Partition range into twopartition_point : Get partition pointSorting std :: sort : Sort elements in rangestd :: stable_sort : Sort elements preserving order of equivalentsstd :: partial_sort : Partially sort elements in rangestd :: partial_sort_copy : Copy and partially sort rangestd :: is_sorted : Check whether range is sortedstd :: is_sorted_until : Find first unsorted element in rangestd :: nth_element : Sort element in rangeBinary search (operating on partitioned/sorted ranges) std :: lower_bound : Return iterator to lower boundstd :: upper_bound : Return iterator to upper boundstd :: equal_range : Get subrange of equal elementsstd :: binary_search : Test if value exists in sorted sequenceMerge (operating on sorted ranges) std :: merge : Merge sorted rangesstd :: inplace_merge : Merge consecutive sorted rangesstd :: includes : Test whether the sorted range includes another sorted rangestd :: set_union : Union of two sorted rangesstd :: set_intersection : Intersection of two sorted rangesstd :: set_difference : Difference of two sorted rangesstd :: set_symmetric_difference : Symmetric difference of two sorted rangesHeap Operations std :: push_heap : Push element into heap rangestd :: pop_heap : Pop element from heap rangestd :: make_heap : Make heap from rangestd :: sort_heap : Sort elements of heapstd :: is_heap : Test if range is heapstd :: is_heap_until : Find first element not in heap orderstd :: max : Return the largeststd :: minmax : Return smallest and largest elementsstd :: min_element : Return smallest element in rangestd :: max_element : Return largest element in rangestd :: minmax_element : Return smallest and largest elements in rangeOther Operations std :: lexicographical_compare : Lexicographical less-than comparisonstd :: next_permutation : Transform range to next permutationstd :: prev_permutation : Transform range to previous permutation All STL articles of C++ Anonymous Explore C++ BasicsIntroduction to C++3 min readData Types in C++6 min readVariables in C++4 min readOperators in C++9 min readBasic Input / Output in C++5 min readControl flow statements in Programming15+ min readLoops in C++7 min readFunctions in C++8 min readArrays in C++8 min readCore ConceptsPointers and References in C++5 min readnew and delete Operators in C++ For Dynamic Memory5 min readTemplates in C++8 min readStructures, Unions and Enumerations in C++3 min readException Handling in C++12 min readFile Handling through C++ Classes8 min readMultithreading in C++8 min readNamespace in C++5 min readOOP in C++Object Oriented Programming in C++8 min readInheritance in C++6 min readPolymorphism in C++5 min readEncapsulation in C++4 min readAbstraction in C++4 min readStandard Template Library(STL)Standard Template Library (STL) in C++3 min readContainers in C++ STL3 min readIterators in C++ STL10 min readC++ STL Algorithm Library3 min readPractice & ProblemsC++ Interview Questions and Answers1 min readC++ Programming Examples4 min read Article Tags : C++ STL cpp-advanced cpp-algorithm-library cpp-containers-library +1 More Like