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
+1 -1
View File
@@ -7,7 +7,7 @@
#include "../utils/common.h"
/* 零钱兑换:贪心 */
int coinChangeGreedy(int* coins, int size, int amt) {
int coinChangeGreedy(int *coins, int size, int amt) {
// 假设 coins 列表有序
int i = size - 1;
int count = 0;
+2 -4
View File
@@ -7,12 +7,10 @@
#include "../utils/common.h"
/* 物品 */
struct Item {
typedef struct {
int w; // 物品重量
int v; // 物品价值
};
typedef struct Item Item;
} Item;
/* 按照价值密度排序 */
int sortByValueDensity(const void *a, const void *b) {