qsorttest - /* */ @file qsorttest.cpp @author William...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
/** @file qsorttest.cpp @author William Duncan @date 2005-10-01 Description: This program measures the runtime for the qsort algorithm. Course: CS1254.02 Logon ID: cs1254xx Lab #: 3 Instructor: William Duncan */ #include <iostream> #include <cstdlib> #include <sys/time.h> #include <iomanip> #include "qsortcode.h" #include "qsortcode.cpp" void genIntRandArray(int* Array, int size); void genIntDescArray(int* Array, int size); void genDblRandArray(double* Array, int size); void genDblDescArray(double* Array, int size); struct timeval subtime(struct timeval start, struct timeval end); using namespace std; int main(int argc, char **argv) { struct timeval start_t, end_t, elapsed_t; struct timezone tz; int *Array; double *dArray; int i; int size[] = {50, 100, 500, 1000, 5000, 10000, 30000}; srand(time(NULL)); /* The array of size 50 is printed to verify that the array is indeed been sorted. The elments of the arrays are not printed for other sizes. */ /* Sort an array of integers. */
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/17/2012 for the course CSC 1254 taught by Professor Blanks,l during the Fall '08 term at LSU.

Page1 / 4

qsorttest - /* */ @file qsorttest.cpp @author William...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online