From c581e83017038bd90e1e972fa9e277fc5e773365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hillerstr=C3=B6m?= Date: Wed, 23 Oct 2024 09:13:03 +0200 Subject: [PATCH] Update knapsack.ml --- examples/knapsack.ml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/knapsack.ml b/examples/knapsack.ml index 8f0011c..77b490a 100644 --- a/examples/knapsack.ml +++ b/examples/knapsack.ml @@ -51,10 +51,9 @@ let knapsack : int array -> int array -> int -> int (* if w > c *) (* then solver (i+1) n c *) (* else *) -(* let option1 = solver (i + 1) n c in *) -(* let pn = ps.(i) in *) -(* let option2 = pn + solver (i + 1) n (c - w) in *) -(* max option1 option2 *) +(* let tt = ps.(i) + solver (i + 1) n (c - w) in *) +(* let ff = solver (i + 1) n c in *) +(* max tt ff *) (* in *) (* solver 0 (Array.length ps) cap *)