We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26ca371 commit 3e179dcCopy full SHA for 3e179dc
src/main/scala/algorithms/dynamic/BackpackWeight.scala
@@ -11,7 +11,7 @@ package algorithms.dynamic
11
/// - Base Case: dp(0) = true (the empty subset)
12
/// - For each item weight and for each w from W down to that weight:
13
/// if dp(w - weight) is true then dp(w) becomes true.
14
-///
+///
15
/// Time Complexity: O(n * W), where n is the number of items and W is the capacity.
16
def maxReachableWeight(weights: Array[Int], W: Int): (Int, Array[Boolean]) = {
17
// Initialize DP array: only 0 is reachable at the start.
0 commit comments