随笔分类 - algorithm 模板
sort漫谈
摘要:转载自:http://www.cppblog.com/changshoumeng/articles/114379.html#_Toc260776773详细解说 STL 排序(Sort) 0 前言: STL,为什么你必须掌握1 STL提供的Sort 算法 --------------------------------------------------------------------------------1.1 所有sort算法介绍1.2 sort 中的比较函数1.3 sort 的稳定性1.4 全排序1.5 局部排序1.6 nth_element 指定元素排序1.7 partition
阅读全文
for_each
摘要:for_each 1 //对序列中的每个元素执行某操作 for_each() 2 /*template<class InputIterator, class Function> 3 Function for_each(InputIterator first, InputIterator last, Function f) 4 { 5 for ( ; first!=last; ++first ) f(*first); 6 return f; 7 }*/ 8 #include<iostream> 9 #include <vector>10 using names
阅读全文
浙公网安备 33010602011771号