feat(codes/c): add C include/ codes and modify exist C codes

This commit is contained in:
reanon
2023-01-11 00:48:48 +08:00
parent 17de5fd5d1
commit 24cdcd54df
16 changed files with 423 additions and 41 deletions

View File

@@ -0,0 +1,2 @@
add_executable(time_complexity time_complexity.c )
add_executable(worst_best_time_complexity worst_best_time_complexity.c)

View File

@@ -41,7 +41,7 @@ int main(int argc, char *argv[]) {
int *nums = randomNumbers(n);
int index = findOne(nums, n);
printf("\n数组 [ 1, 2, ..., n ] 被打乱后 = ");
printArray(nums, n);
PrintArray(nums, n);
printf("数字 1 的索引为 %d\n", index);
// 释放堆区内存
if (nums != NULL) {
@@ -49,6 +49,5 @@ int main(int argc, char *argv[]) {
nums = NULL;
}
}
getchar();
return 0;
}