AI工具人
提示词工程师

ACM竞赛常用STL(二)之STL--algorithm



<algorithm>无疑是STL 中最大的一个头文件,它是由一大堆模板函数组成的。

下面列举出<algorithm>中的模板函数:

adjacent_find / binary_search / copy / copy_backward / count

/ count_if / equal / equal_range / fill / fill_n / find /

find_end / find_first_of / find_if / for_each / generate /

generate_n / includes / inplace_merge / iter_swap /

lexicographical_compare / lower_bound / make_heap / max /

max_element / merge / min / min_element / mismatch /

next_permutation / nth_element / partial_sort /

partial_sort_copy / partition / pop_heap / prev_permutation

/ push_heap / random_shuffle / remove / remove_copy /

remove_copy_if / remove_if / replace / replace_copy /

replace_copy_if / replace_if / reverse / reverse_copy /

rotate / rotate_copy / search / search_n / set_difference /

set_intersection / set_symmetric_difference / set_union /

sort / sort_heap / stable_partition / stable_sort / swap /

swap_ranges / transform / unique / unique_copy / upper_bound

如果详细叙述每一个模板函数的使用,足够写一本书的了。还是来看几个简单

的示例程序吧。

示例程序之一,for_each 遍历容器:

赞(0) 打赏
未经允许不得转载:XINDOO » ACM竞赛常用STL(二)之STL--algorithm
描述文字

评论 抢沙发

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫