mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
feat(codes/c): add C include/ codes and modify exist C codes
This commit is contained in:
2
codes/c/chapter_computational_complexity/CMakeLists.txt
Normal file
2
codes/c/chapter_computational_complexity/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
add_executable(time_complexity time_complexity.c )
|
||||
add_executable(worst_best_time_complexity worst_best_time_complexity.c)
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user