public TD01Knapsack(int capacity, int w[], int v[])
	{
		int n = w.length;

		// capacity ranges from 0 to 'capacity'
		vKnapsack = new int[capacity + 1];
		contentsKnapsack = new String[capacity + 1];
		for (int i = 0; i <= capacity; i++)
		{
			vKnapsack[i] = Integer.MIN_VALUE;
			contentsKnapsack[i] = "";
		}
		vKnapsack[0] = 0; // base case : knapsack of capacity 0 has no value

		// initially there are no items in the knapsack
		inKnapsack = new boolean[n];
		for (int i = 0; i < n; i++)
			inKnapsack[i] = false;

		knapsack(n, capacity, w, v);
	}