Knapsack Problem - Online Code


This is a program for implementing 0-1 knapsack problem

Source Code

#include <stdio.h>

	 #define MAXWEIGHT 100

	 int n = 3; /* The number of objects */

	 int c[10] = {8, 6, 4};

	 /* c[i] is the *COST* of the ith object; i.e. what

					YOU PAY to take the object */

... (login or register to view full code)

To view full code, you must Login or Register, its FREE.

Hey, registering yourself just takes less than a minute and opens up a whole new GetGyan experience.


No comment yet. Be the first to post a comment.