上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 38 下一页
摘要: 1. random_shuffle() 随机打乱 2. partition() 不稳定的 3. stable_partition() 稳定的 #include <iostream> #include <algorithm> #include <vector> #include <iterator> 阅读全文
posted @ 2015-03-10 12:40 SandKing 阅读(8) 评论(0) 推荐(0)
摘要: 1. next_permutation() 原始数据为升序 2. prev_permutation() 原始数据为降序 #include <iostream> #include <algorithm> #include <vector> using namespace std; int main( 阅读全文
posted @ 2015-03-10 11:56 SandKing 阅读(8) 评论(0) 推荐(0)
摘要: 1. reverse() 2. reverse_copy() 3. rotate() 4. rotate_copy() #include <iostream> #include <algorithm> #include <vector> #include <iterator> using names 阅读全文
posted @ 2015-03-10 11:36 SandKing 阅读(9) 评论(0) 推荐(0)
摘要: 1. unique( b, e ) //删除连续的重复的数据。留下唯一 2. unique( b, e, p ) 3. unique_copy( b1, e1, b2 ) 4. unique_copy( b1, e1, b2, p ) 注意: 1.应该有一个unique_if(), 但是没有 2.应 阅读全文
posted @ 2015-03-09 18:55 SandKing 阅读(5) 评论(0) 推荐(0)
摘要: 1. remove_copy() 2. remove_copy_if() #include <iostream> #include <algorithm> #include <list> #include <vector> #include <set> #include <iterator> usi 阅读全文
posted @ 2015-03-09 18:30 SandKing 阅读(7) 评论(0) 推荐(0)
摘要: 1. remove() 2. remove_if() 注意: 1.并不是真正的删除,而是把后面的元素向前移动,覆盖被删除元素 2.返回新的逻辑终点 #include <iostream> #include <algorithm> #include <list> #include <vector> u 阅读全文
posted @ 2015-03-09 18:09 SandKing 阅读(4) 评论(0) 推荐(0)
摘要: 1. replace( b, e, ov, nv ) 2. replace_if( b, e, p, v ) 3.replace_copy( b1, e1, b2, ov, nv ) 4.replace_copy_if(b1, e1, b2, p, v ) #include <iostream> # 阅读全文
posted @ 2015-03-09 17:13 SandKing 阅读(5) 评论(0) 推荐(0)
摘要: 1. fill(b, e, v) 2. fill_n(b, n, v) 3.generate(b, e, p ) 4.generate_n(b, n, p) #include <iostream> #include <algorithm> #include <vector> #include <de 阅读全文
posted @ 2015-03-09 13:54 SandKing 阅读(7) 评论(0) 推荐(0)
摘要: 1. swap_ranges(b, e, b2) 2.注意:下列两种方法也是交换算法 (1) 容器的swap() 成员函数 (2) 赋值操作 #include <iostream> #include <algorithm> #include <vector> #include <deque> usi 阅读全文
posted @ 2015-03-09 12:33 SandKing 阅读(7) 评论(0) 推荐(0)
摘要: 1. for_each() 速度快 不灵活(只能对一个容器的某个区间进行操作) 2. transform() 速度慢 非常灵活(可以对多个容器的多个区间操作) #include <iostream> #include <algorithm> #include <vector> using names 阅读全文
posted @ 2015-03-06 18:45 SandKing 阅读(28) 评论(0) 推荐(0)
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 38 下一页