No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
[CODE]#include "Sorts.h" Sorts::Sorts(void) { } Sorts::~Sorts(void) { } void Sorts::insert() { ofstream myfile; myfile.open ("InsertSorted.txt"); starttime=(long)time(NULL); int A[ELEMENTS]={5,2,4,6,1,3}; insertsort(A,ELEMENTS); cout<<endl<<"Sorted list "<<endl; for(x=0;x<ELEMENTS;x++) { cout<<A[x]; } endtime=(long)time(NULL); totalseconds=endtime-starttime; minutes=totalseconds/60; seconds=totalseconds%60; cout<<"\nStart time: "<<starttime; cout<<"\nEnd Time: "<<endtime; cout<<"\nElapsed Time: "<<minutes<<" min, "<<seconds<<" seconds"<<endl;"\n\n"; } void Sorts::insertsort(int A[],int length) { for(int j=1;j<length;j++) … |