Skip to content

Commit

Permalink
sorted_squares
Browse files Browse the repository at this point in the history
  • Loading branch information
Chong Liu committed Jan 29, 2024
1 parent 7cff0d5 commit 38a0cd9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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_

/**********************************************************************************/
/* */
Expand All @@ -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 */
#endif /* F02_PROGRAMMING_TOPICS_F01_DATA_STRUCTURE_01_ARRAY_03_SORTEDSQUARES_CFG_COMPILE_CFG_H_ */

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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_ */
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
/* 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 (解题方法配置文件) */
Expand Down Expand Up @@ -115,4 +115,4 @@ int main(int argc, const char *argv[]) {
Test2();
Test3();
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/* Standard header file (标准头文件) */
#include <stdlib.h>
/* solution header file (题解头文件) */
#include "sortedSquares.h"
#include "sorted_squares.h" /* NOLINT */

/**********************************************************************************/
/**********************************************************************************/
Expand All @@ -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; /* 左指针 */
Expand Down

0 comments on commit 38a0cd9

Please sign in to comment.