Skip to content

Commit f8e182a

Browse files
committed
Optimized KnapsackMemoization algorithm
1 parent 7d73a1d commit f8e182a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/thealgorithms/dynamicprogramming/KnapsackMemoization.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int knapSack(int capacity, int[] weights, int[] profits, int numOfItems) {
1919

2020
// Loop to initially fill the table with -1
2121
for(int []table:dpTable){
22-
Arrays.fill(table,-1);g
22+
Arrays.fill(table,-1);
2323
}
2424

2525
return solveKnapsackRecursive(capacity, weights, profits, numOfItems, dpTable);

0 commit comments

Comments
 (0)