- 博客(5)
- 收藏
- 关注
原创 排序---冒泡排序
冒泡排序 思想: 一种交换排序,它的基本思想是:两两比较相邻记录的关键字,如果反序则交换,知道没有反序记录为止。 标准冒泡排序: void bubbelSort(int *a,int n) { int i,j,temp; for( i = 0; i< n-1; i++) //i从数组第一个数的下标开始循环 for(j = n-1; j>=i; j--)
2015-09-14 16:41:00
212
原创 STL map,vector和pair的混合应用
定义一个map对象,其元素的键是家族姓氏,而值则存储的是一个vecor,vector存放的是家族人的名字和年龄的pair对象。然后通过键值可以查询打印该家族的所有成员信息。 #include #include #include #include using namespace std; int main(int argc,char *argv[]) { map > > children
2015-09-08 12:49:58
876
原创 STL map的使用
#include #include #include using namespace std; ifstream& open_file(ifstream &in, const string &file) { in.close(); in.clear(); in.open(file.c_str()); return in; } int main(int argc,char *ar
2015-09-08 11:31:36
193
原创 java多线程
1、java多线程的实现主要有两种方式:分别为继承Thread类 和 实现接口Runnable。 在Thread类和Runable均有run()方法,当实现多线程时,需要对它们进行覆盖重写。
2015-08-23 18:44:00
212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人