mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-15 13:10:59 +00: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:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user