摘要: 顺序表的概念:顺序表就是用连续的存储空间来存储数据。顺序表的优点:方便查询,当查询时,直接用下标就可以,时间复杂度O(1);遇到的问题:srand函数中time()方法要加上头文件#include <time.h> ,使用srand()时,rand()函数生成的随机数会不同,srand()在for循环的外面。代码:#include <iostream>#include <cstdlib>#include <time.h>using namespace std;struct Snode{ int i; int data;}Slist[50];int 阅读全文
posted @ 2013-04-12 10:15 xshang 阅读(676) 评论(0) 推荐(1) 编辑