/* timhsrt.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Time the sort of double precision reals using hsort Input parameter: n -> number of double values to sort */ #include #include "ccmath.h" main(na,av) int na; char **av; { int i,f,n; double *x,**v; clock_t st,en; unsigned int seed; if(na!=2){ printf("para: size\n"); exit(1);} n=atoi(*++av); seed=(unsigned int)time(NULL); setnrml(seed); printf(" Time Heap Sort\n"); printf(" %d points input\n",n); x=(double *)calloc(n,sizeof(*x)); v=(double **)calloc(n,sizeof(x)); for(i=0; i