Skip to content

Commit aa63e93

Browse files
Sheniththuva4
authored andcommitted
Update.java (thuva4#498)
1 parent aa99a08 commit aa63e93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

DynamicProgramming/Java/Knapsack.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static boolean[] includedItems(int[] weights, int[][] v) {
3535
return items;
3636
}
3737

38-
public static void main(String[] args) {
38+
public static void main(String[] args) { //main method.
3939
final int capacity = 8;
4040
final int[] values = {2, 5, 10, 14, 15};
4141
final int[] weights = {1, 3, 4, 5, 7};
@@ -46,6 +46,7 @@ public static void main(String[] args) {
4646
System.out.println("Weights = " + Arrays.toString(weights));
4747
System.out.println();
4848

49+
//getting maxVAlue
4950
maxValue(capacity, weights, values, v);
5051
final int b = v[weights.length][capacity];
5152
System.out.println("v:");

0 commit comments

Comments
 (0)