diff --git a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/cfg/compileCfg.h b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/cfg/compile_cfg.h similarity index 90% rename from F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/cfg/compileCfg.h rename to F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/cfg/compile_cfg.h index 39fbae26..c68f9e64 100644 --- a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/cfg/compileCfg.h +++ b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/cfg/compile_cfg.h @@ -9,8 +9,8 @@ * ================================================================================= * @Description : common function configuration file Common function configuration file (通用函数配置文件) */ -#ifndef __COMPILE_CFG_H -#define __COMPILE_CFG_H +#ifndef F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_CFG_COMPILE_CFG_H_ +#define F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_CFG_COMPILE_CFG_H_ /**********************************************************************************/ /* */ @@ -37,4 +37,4 @@ #define BTREE_LEVEL_ORDER_STRUCT_METHOD_EN 0 /* 二叉树层序遍历方法编译使能 1: enable, 0: disable */ #endif /* COMMON_BINARY_TREE_EN */ -#endif /* __COMPILE_CFG_H */ \ No newline at end of file +#endif /* F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_CFG_COMPILE_CFG_H_ */ diff --git a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/inc/sortedSquares.h b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/inc/sortedSquares.h deleted file mode 100644 index 0d07099c..00000000 --- a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/inc/sortedSquares.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * @FilePath : \Practice_LeetCode_C\01_Programming_Topics\01_Array\03_sortedSquares\inc\sortedSquares.h - * @Author : Chong Liu - * @CreateDate : 2023-12-28 17:25:17 - * @LastEditors : Chong Liu - * @LastEditTime : 2023-12-29 10:20:15 - * ================================================================================= - * Copyright (c) 2023 by Chong Liu, All Rights Reserved. - * ================================================================================= - * @Description : solution header file - */ -#ifndef __SORTED_SQUARES_H -#define __SORTED_SQUARES_H - -int *sortedSquares(int *nums, int numsSize, int *returnSize); - -#endif /* __SORTED_SQUARES_H */ diff --git a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/inc/sorted_squares.h b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/inc/sorted_squares.h new file mode 100644 index 00000000..4b83375d --- /dev/null +++ b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/inc/sorted_squares.h @@ -0,0 +1,17 @@ +/* + * @FilePath : \Practice_LeetCode_C\F02_Programming_Topics\F01_Data_Structure\01_Array\03_sortedSquares\inc\sorted_squares.h + * @Author : Chong Liu + * @CreateDate : 2023-12-28 17:25:17 + * @LastEditors : Chong Liu + * @LastEditTime : 2024-01-29 12:35:57 + * ================================================================================= + * Copyright (c) 2023 by Chong Liu, All Rights Reserved. + * ================================================================================= + * @Description : solution header file + */ +#ifndef F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_INC_SORTED_SQUARES_H_ +#define F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_INC_SORTED_SQUARES_H_ + +int *sortedSquares(int *nums, int numsSize, int *returnSize); + +#endif /* F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_INC_SORTED_SQUARES_H_ */ diff --git a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/main.c b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/main.c index 160df66a..91c5fd12 100644 --- a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/main.c +++ b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/main.c @@ -3,17 +3,17 @@ * @Author : Chong Liu * @CreateDate : 2023-09-16 08:57:10 * @LastEditors : Chong Liu - * @LastEditTime : 2024-01-21 01:48:04 + * @LastEditTime : 2024-01-29 12:37:15 * ================================================================================= * Copyright (c) 2023 by Chong Liu, All Rights Reserved. * ================================================================================= * @Description : leetcode 977.有序数组的平方:https://leetcode.cn/problems/squares-of-a-sorted-array/ * https://programmercarl.com/0977.%E6%9C%89%E5%BA%8F%E6%95%B0%E7%BB%84%E7%9A%84%E5%B9%B3%E6%96%B9.html */ -/* solution header file (题解头文件) */ -#include "sortedSquares.h" /* Standard header file (标准头文件) */ #include +/* solution header file (题解头文件) */ +#include "sorted_squares.h" /* NOLINT */ /* Common function header file (通用头文件) */ #include "F01_Common_Functions/inc/common_array.h" /* solution method configuration header file (解题方法配置文件) */ @@ -115,4 +115,4 @@ int main(int argc, const char *argv[]) { Test2(); Test3(); return 0; -} \ No newline at end of file +} diff --git a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/src/sortedSquares.c b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/src/sorted_squares.c similarity index 98% rename from F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/src/sortedSquares.c rename to F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/src/sorted_squares.c index 47769c3f..8b30f2ee 100644 --- a/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/src/sortedSquares.c +++ b/F02_Programming_Topics/F01_Data_Structure/01_Array/03_sortedSquares/src/sorted_squares.c @@ -12,7 +12,7 @@ /* Standard header file (标准头文件) */ #include /* solution header file (题解头文件) */ -#include "sortedSquares.h" +#include "sorted_squares.h" /* NOLINT */ /**********************************************************************************/ /**********************************************************************************/ @@ -30,7 +30,7 @@ * @return {int} *result 返回数组 */ int *sortedSquares(int *nums, int numsSize, int *returnSize) { - int *result = (int *)malloc(numsSize * sizeof(int)); /* 分配内存 */ + int *result = (int *)malloc(numsSize * sizeof(int)); /* NOLINT */ *returnSize = numsSize; /* 返回数组大小 */ int left = 0; /* 左指针 */