summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--01-knapsack/ks_dp-ng.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/01-knapsack/ks_dp-ng.c b/01-knapsack/ks_dp-ng.c
index c2216fc..7830651 100644
--- a/01-knapsack/ks_dp-ng.c
+++ b/01-knapsack/ks_dp-ng.c
@@ -105,7 +105,7 @@ static void solve(Solver* solver)
if (debug > 2)
{
- printf("\ncurrent V(i,s,W,r)\n");
+ printf("\nformat V(i,W)\n");
}
/* SOLVE */
@@ -115,7 +115,6 @@ static void solve(Solver* solver)
{
v = item->v;
w = item->w;
- data = NULL;
data = solver->column + solver->k;
up_left = solver->column + (solver->k - w);
@@ -139,10 +138,11 @@ static void solve(Solver* solver)
if (debug > 2)
{
+ printf("i=%d; j=k; j<=%d:\n", i, lower_bound);
data = solver->column;
for (j = 0; j <= k; j++, data++)
- printf(" % 4d(% 2d % 2d)\n",
- data->v, data->i, data->w);
+ printf(" %d : % 4d(% 2d % 2d)\n",
+ j, data->v, data->i, data->w);
printf("\n");
}
}