Simplify struct declarations of C.

Use PascalCase for all structs in C.
SImplify n_queens.c
Format C code for chapter of graph.
This commit is contained in:
krahets
2023-10-18 02:16:26 +08:00
parent 070d23ee6e
commit 1e49574332
35 changed files with 503 additions and 599 deletions

View File

@@ -147,12 +147,10 @@
```c title=""
/* 链表节点结构体 */
struct ListNode {
typedef struct ListNode {
int val; // 节点值
struct ListNode *next; // 指向下一节点的指针
};
typedef struct ListNode ListNode;
} ListNode;
/* 构造函数 */
ListNode *newListNode(int val) {
@@ -617,13 +615,11 @@
```c title=""
/* 双向链表节点结构体 */
struct ListNode {
typedef struct ListNode {
int val; // 节点值
struct ListNode *next; // 指向后继节点的指针
struct ListNode *prev; // 指向前驱节点的指针
};
typedef struct ListNode ListNode;
} ListNode;
/* 构造函数 */
ListNode *newListNode(int val) {