0
我在网上找到了关于测量合并排序的执行时间的代码。我无法理解将数值放入数组的部分。在该行中:b [i] = i + 352; 352的价值是什么?如果我想要一个数组大小为2000,3000,4000等,下一个值是什么。(C++)合并排序执行时间
int b[1000];
int i;
for (i = 0; i < 1001; i++) {
b[i] = i + 352 ;
} //put values into array
int n = sizeof b/sizeof b[0];
clock_t start = clock();
merge_sort(b, n);
clock_t end = clock();
double elapsed1 = ((end - start)/CLOCKS_PER_SEC);// seconds elapse
printf("Time elapsed for merge 1000: %f\n", elapsed1);