STL 算法分类

来源:互联网 发布:java源代码文件夹在 编辑:程序博客网 时间:2024/05/21 18:41

转自: http://blog.csdn.net/qinivy/article/details/5038089


1 不改变操作对象内容的算法

  1.1 线性查找: find; find_if; adjacent_find; find_first_of.

  1.2 子序列匹配: search; find_end; search_n.

  1.3 计算元素个数: count; count_if.

  1.4 遍历元素: for_each.

  1.5 比较两个Ranges: equal; mismatch; lexicographical_compare.

  1.6 最大值与最小值: min; max; min_element; max_element.

2 改变操作对象内容的算法

  2.1 复制区间: copy; copy_backward.

  2.2 互换元素: swap; iter_swap; swap_ranges.

  2.3 transform

  2.4 替换元素: replace; replace_if; replace_copy; replace_if.

  2.5 填充整个区间: fill; fill_n; generate; generate_n.

  2.6 移除元素: remove; remove_if; remove_copy; remove_copy_if; unique; unique_copy.

  2.7 排列算法: reverse; revers_copy; rotate; rotate_copy; next_permutation; prev_permutation.

  2.8 分割: partition; stable_partition.

  2.9 随机重排与抽样: random_shuffle; random_sample; random_sample_n.

  2.10 数值算法: accumulate; inner_product; partial_sum.

3 排序和查找

  3.1 排序: sort; stable_sort; partial_sort; partial_sort_copy; nth_element; is_sorted.

  3.2 二分查找: binary_search; lower_bound; upper_bound; equal_range.

  3.3 合并: merge; inplace_merge.

  3.4 已排序区间的集合操作: includes; set_union; set_intersection; set_difference; set_symmetric_difference.

  3.5 堆操作: make_heap; push_heap; pop_heap; sort_heap; is_heap.



原创粉丝点击