常用STL函数用法
2014-02-06 17:10
176 查看
C++标准库总结
algorithm常用函数:("#"有该函数的实现)
非修改性序列操作 :
for_each遍历
find和find_if
count和count_if
mismatch
equal
search和search_n
is_permutation 是否是同一个排列,判断两个集合是否含有相同的元素#
修改性的序列操作 :
copy,copy_n,copy_if
transform
replace,replace_if,replace_copy,replace_copy_if
fill,fill_n
generate,generate_n
remove,remove_if
unique 去除相邻重复元素
reverse(t1.begin(),t1.end());//反转
rotate(t1.begin(),t1.begin()+4,t1.end());//循环移动
shuffle,random_shuffle 随机移动元素
划分:
partition#
is_partitioned#
sort#
二叉树:
lower_bound与upper_bound#
归并(已排序集合):
merge#
set_union,set_intersection,set_difference合集、交集、差集#
堆:
make_heap,push_heap,pop_heap,sort_heap(以最大的K个数为例)
其他:
next_permutation#
正在整理中......
algorithm常用函数:("#"有该函数的实现)
非修改性序列操作 :
for_each遍历
find和find_if
count和count_if
mismatch
equal
search和search_n
is_permutation 是否是同一个排列,判断两个集合是否含有相同的元素#
修改性的序列操作 :
copy,copy_n,copy_if
transform
replace,replace_if,replace_copy,replace_copy_if
fill,fill_n
generate,generate_n
remove,remove_if
unique 去除相邻重复元素
reverse(t1.begin(),t1.end());//反转
rotate(t1.begin(),t1.begin()+4,t1.end());//循环移动
shuffle,random_shuffle 随机移动元素
划分:
partition#
is_partitioned#
sort#
二叉树:
lower_bound与upper_bound#
归并(已排序集合):
merge#
set_union,set_intersection,set_difference合集、交集、差集#
堆:
make_heap,push_heap,pop_heap,sort_heap(以最大的K个数为例)
其他:
next_permutation#
正在整理中......
相关文章推荐
- C++STL 常用 函数 用法
- C++STL 常用 函数 用法
- C++ STL 常用 函数 用法
- C++ STL replace()函数常用用法详解
- STL vector用法介绍+ STL 常用函数用法
- C++STL 常用 函数 用法
- C++STL 常用 函数 用法
- C++STL 常用 函数 用法
- C++STL 常用 函数 用法
- C++STL 常用 函数 用法
- 【转】 C++STL 常用 函数 用法
- STL的常用用法、函数汇总(不定时更新)
- C++ STL常用函数用法
- STL中的常用的vector,map,set,Sort用法
- STL Stack/Queue/Set常用函数
- STL之常用容器用法
- c++中的string常用函数用法总结
- 【STL】vector,string,queue,list,set用法及函数总结
- 常用STL用法总结
- stl string常用函数