mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user