mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 14:59:53 +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:
@@ -12,13 +12,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* 链表节点结构体 */
|
||||
struct ListNode {
|
||||
typedef struct ListNode {
|
||||
int val; // 节点值
|
||||
struct ListNode *next; // 指向下一节点的引用
|
||||
};
|
||||
|
||||
// typedef 作用是为一种数据类型定义一个新名字
|
||||
typedef struct ListNode ListNode;
|
||||
} ListNode;
|
||||
|
||||
/* 构造函数,初始化一个新节点 */
|
||||
ListNode *newListNode(int val) {
|
||||
@@ -56,4 +53,4 @@ ListNode *getListNode(ListNode *head, int val) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LIST_NODE_H
|
||||
#endif // LIST_NODE_H
|
||||
|
||||
Reference in New Issue
Block a user