1 #include "Utility.h" 2 3 #include <List.h> 4 #include <stdlib.h> 5 #include <stdio.h> 6 7 8 int32 gIterations = 1000000; 9 int32 gNumber = 8; 10 11 12 int main(int argc,char ** argv)13main(int argc,char **argv) 14 { 15 char buffer[1024]; 16 sorted_array *array = (sorted_array *)buffer; 17 array->count = 0; 18 19 srand(42); 20 21 for (int32 i = 0;i < gIterations;i++) { 22 // add entries to the array 23 24 for (int32 num = 0;num < gNumber;num++) 25 array->Insert(rand()); 26 27 for (int32 num = 0;num < gNumber;num++) { 28 int32 index = int32(1.0 * rand() * array->count / RAND_MAX); 29 array->Remove(array->values[index]); 30 } 31 } 32 return 0; 33 } 34