Библиотека Algorithms
Материал из cppreference.com
< cpp
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
В библиотеке Algorithms определены функции для различных целей (например, поиска, сортировки, подсчета, манипулирования), оперирующие над диапазонами элементов. Обратите внимание, что такой диапазон определяется как [first, last)
, где last
относится к элементу, следующему за последним просматриваемым или изменяемым элементом.
Определено в файле <algorithm>
| |
(C++11) (C++11) (C++11) |
проверяет, является ли предикат верным (true) для всех (all_of), хотя бы одного из (any_of) или ни одного (none_of) из элементов в диапазоне (шаблон функции) |
применяет функцию к диапазону элементов (шаблон функции) | |
возвращает количество элементов, удовлетворяющих определенным критериям Original: returns the number of elements satisfying specific criteria The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
находит первое положение, в котором два диапазона отличаются Original: finds the first position where two ranges differ The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
определяет, будет ли два множества элементов одинаковы Original: determines if two sets of elements are the same The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
находит первый элемент, удовлетворяющий определенным критериям Original: finds the first element satisfying specific criteria The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
находит последний последовательности элементов в определенном диапазоне Original: finds the last sequence of elements in a certain range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
searches for any one of a set of elements (шаблон функции) | |
найти два одинаковых (или некоторых других отношениях) элементы примыкают друг к другу Original: finds two identical (or some other relationship) items adjacent to each other The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
searches for a range of elements (шаблон функции) | |
поиск в течение ряда последовательных копий элемента в диапазоне Original: searches for a number consecutive copies of an element in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Original: Modifying sequence operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <algorithm>
| |
(C++11) |
копирует диапазон элементов (шаблон функции) |
(C++11) |
копирует ряд элементов в новом месте Original: copies a number of elements to a new location The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
копии диапазон элементов в обратном порядке Original: copies a range of elements in backwards order The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
перемещает диапазон элементов в новое место Original: moves a range of elements to a new location The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
(C++11) |
перемещает диапазон элементов в новое место в обратном порядке Original: moves a range of elements to a new location in backwards order The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
назначает диапазон элементов определенного значения Original: assigns a range of elements a certain value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
присваивает значение числа элементов Original: assigns a value to a number of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
применяет функцию к различным элементам Original: applies a function to a range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
сохраняет результат функции в диапазоне Original: saves the result of a function in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
сохраняет результат N приложениях функции Original: saves the result of N applications of a function The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
удаляет элементы, удовлетворяющие определенным критериям Original: removes elements satisfying specific criteria The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Копирует диапазон элементов опуская те, которые удовлетворяют определенным критериям Original: copies a range of elements omitting those that satisfy specific criteria The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
заменяет все значения, удовлетворяющие определенным критериям с другим значением Original: replaces all values satisfying specific criteria with another value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Копирует диапазон, заменив элементов, удовлетворяющих определенным критериям с другим значением Original: copies a range, replacing elements satisfying specific criteria with another value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
свопы значения двух объектов Original: swaps the values of two objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
свопы двух диапазонах элементы Original: swaps two ranges of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
свопы элементов указал на двух итераторов Original: swaps the elements pointed to by two iterators The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
изменяет порядок элементов в диапазоне Original: reverses the order elements in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
создает копию диапазон, который меняется на противоположную Original: creates a copy of a range that is reversed The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
вращается порядок элементов в диапазоне Original: rotates the order of elements in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
копии и вращать в диапазоне элементов Original: copies and rotate a range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
случайно повторных заказов элементы в диапазоне Original: randomly re-orders elements in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
removes consecutive duplicate elements in a range (шаблон функции) | |
создает копию некоторый диапазон элементов, который не содержит последовательные дубликатов Original: creates a copy of some range of elements that contains no consecutive duplicates The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Original: Partitioning operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
определяет, является ли диапазон разбивается данный предикат Original: determines if the range is partitioned by the given predicate The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
делит диапазон элементов на две группы Original: divides a range of elements into two groups The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
copies a range dividing the elements into two groups (шаблон функции) |
разделяет элементы на две группы, сохраняя их относительный порядок Original: divides elements into two groups while preserving their relative order The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
locates the partition point of a partitioned range (шаблон функции) |
Original: Sorting operations (on sorted ranges) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <algorithm>
| |
(C++11) |
проверяет, является ли диапазон отсортированы в порядке возрастания Original: checks whether a range is sorted into ascending order The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
(C++11) |
находит наибольшее отсортированы поддиапазоне Original: finds the largest sorted subrange The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
виды диапазон в порядке возрастания Original: sorts a range into ascending order The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
виды первых элементов N диапазона Original: sorts the first N elements of a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
копии и частично виды диапазон элементов Original: copies and partially sorts a range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
виды диапазон элементов при сохранении порядка между равными элементами Original: sorts a range of elements while preserving order between equal elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Частично видов данного диапазона убедившись, что она разбита на разделы данного элемента Original: partially sorts the given range making sure that it is partitioned by the given element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Original: Binary search operations (on sorted ranges) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <algorithm>
| |
возвращает итератор на первый элемент' не менее, чем заданное значение Original: returns an iterator to the first element not less than the given value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
возвращает итератор на первый элемент' больше, чем определенное значение Original: returns an iterator to the first element greater than a certain value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
возвращает набор элементов для конкретного ключа Original: returns range of elements matching a specific key The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Original: Set operations (on sorted ranges) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <algorithm>
| |
слияние двух отсортированных диапазонах Original: merges two sorted ranges The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
объединяет два приказал диапазонов на месте Original: merges two ordered ranges in-place The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
возвращает истину, если один набор является подмножеством другого Original: returns true if one set is a subset of another The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
вычисляет разницу между двумя наборами Original: computes the difference between two sets The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
вычисляет пересечение двух множеств Original: computes the intersection of two sets The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
вычисляет симметрическая разность между двумя наборами Original: computes the symmetric difference between two sets The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
computes the union of two sets (шаблон функции) | |
Original: Heap operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <algorithm>
| |
checks if the given range is a heap (шаблон функции) | |
(C++11) |
находит наибольшее поддиапазон, что это куча Original: finds the largest subrange that is heap The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
создает кучу из ряда элементов Original: creates a heap out of a range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
добавляет элемент в кучу Original: adds an element to a heap The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
удаляет наибольший элемент из кучи Original: removes the largest element from a heap The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Получается куча в отсортированный диапазон элементов Original: turns a heap into a sorted range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Original: Minimum/maximum operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <algorithm>
| |
Возвращает большее из двух элементов Original: returns the larger of two elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
возвращает наибольший элемент в диапазоне Original: returns the largest element in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Возвращает меньшее из двух элементов Original: returns the smaller of two elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
возвращает наименьший элемент в диапазоне Original: returns the smallest element in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
Возвращает большее и меньшее из двух элементов Original: returns the larger and the smaller of two elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
(C++11) |
возвращает наименьший и наибольший элемент в диапазоне Original: returns the smallest and the largest element in a range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
возвращает истину, если один диапазон лексикографически меньше, чем другой Original: returns true if one range is lexicographically less than another The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
(C++11) |
determines if a sequence is a permutation of another sequence (шаблон функции) |
generates the next greater lexicographic permutation of a range of elements (шаблон функции) | |
generates the next smaller lexicographic permutation of a range of elements (шаблон функции) | |
Original: Numeric operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <numeric>
| |
(C++11) |
заполняет диапазон с последовательным шагом в исходное значение Original: fills a range with successive increments of the starting value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) |
вычисляет скалярное произведение двух диапазонах элементы Original: computes the inner product of two ranges of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
вычисляет частичную сумму ряда элементов Original: computes the partial sum of a range of elements The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (шаблон функции) | |
Original: C library The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Определено в файле <cstdlib>
| |
виды диапазон элементов с неопределенным типом Original: sorts a range of elements with unspecified type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) | |
поиск массиве элемент неопределенного типа Original: searches an array for an element of unspecified type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (функция) |