Research Article
A New Look at Worst Case Complexity: A Statistical Approach
Algorithm 1
The “C” code snippet for simulating discrete uniform distribution inputs.
unsigned int iseed = (unsigned int)time(NULL); | srand (iseed); | A=(int *)malloc(n*sizeof(int)); | printf(“Get the elements in random order∖n”); | for( i=1; i<= n; i++) | { | r = (float) rand() / RAND_MAX; | *(A+i)=(int)(k*r)+1; | } |
|