//main.cpp
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <string>
#include <vector>
#include "linklist.cpp"
#define MAXINTLEN 10
using namespace std;
int main(int argc, char *argv[])
{
int tmp[MAXINTLEN];
double runtime = 0;
clock_t s,e;
linklist sl;
for (int i = 0; i < MAXINTLEN; i++)
{
//srand((unsigned)time(i));
tmp[i] = rand()%100;
}
s = clock();
sl.construct_link(tmp,MAXINTLEN);
cout<<"this linklist..."<<endl;
sl.print_link();
sl.reverse();
cout<<"after reverse..."<<endl;
sl.print_link();
e = clock();
runtime = (double)(e - s);//CLOCKS_PER_SEC;
cout<<"runtime is:"<<runtime<<endl;
return 0;
}
// linklist.hxx
#ifndef LINKLIST_H_
#define LINKLIST_H_
#include<iostrea