feat: add C code in chapter_greedy (#755)

* add fractional_knapsack.c

* update CMakeLists

* add c code in chapter_greedy

* fix header format

* format code by clang-format

* remove extra comments

* replace ternary operator to MACRO

* parameters form adjustment

* Update fractional_knapsack.c

* Update max_capacity.c

* Update max_product_cutting.c

* add comments for consistency with cpp ver

* move MIN&MAX macro to source file

* typo fix

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
xianii
2023-09-21 20:52:11 +08:00
committed by GitHub
parent af65ab08ef
commit d225b416cf
5 changed files with 147 additions and 0 deletions
+3
View File
@@ -1 +1,4 @@
add_executable(coin_change_greedy coin_change_greedy.c)
add_executable(fractional_knapsack fractional_knapsack.c)
add_executable(max_capacity fractional_knapmax_capacitysack.c)
add_executable(max_product_cutting max_product_cutting.c)