2012年4月10日
摘要: STL是泛型编程的一个重要组成(目前还没有专门为泛型建立的语言)。STL的设计目的:为了降低编程时的耦合度,提供了大量可复用的技术。其组成部件有: 1、Container(容器):顺序容器(vector、deque、list、string),关联容器(set、multiset、map、multimap) 2、Iterator(迭代器):opterator *、opterator ++、opterator != 、opterator ==、opterator = 3、Algorithm(算法):reverse、find等等。。。 4、Adaptors(配接器):stack、queue、p... 阅读全文
posted @ 2012-04-10 17:27 笔记吧... 可能只有自己看得懂 阅读(187) 评论(0) 推荐(0)
摘要: 1 #include <iostream> 2 using namespace std; 3 4 // 归并排序 5 void Merge(int a[],int b[],int i,int m,int n) 6 { 7 int j,k; 8 for(j = m+1,k=i;i<=m&&j<=n;k++) 9 {10 if(a[i] < a[j]) 11 b[k] = a[i++];12 else 13 b[k] = a[j++];14 }15 16 if(i<=m) ... 阅读全文
posted @ 2012-04-10 11:21 笔记吧... 可能只有自己看得懂 阅读(213) 评论(0) 推荐(0)