Skip to content

Commit d82e849

Browse files
committed
modifiying JSDOCS for uniquepath and zerooneknapsack files in dynamic-programming folder
1 parent 42b95ed commit d82e849

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: Dynamic-Programming/ZeroOneKnapsack.js

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
* https://en.wikipedia.org/wiki/Knapsack_problem
44
*
55
* Time and Space Complexity: O(n*cap)
6+
* @param {Array<[number, number]>} arr - An array of tuples representing the weights and values of items.
7+
* @param {number} n - The number of items available.
8+
* @param {number} cap - The capacity of the thief's bag.
9+
* @param {Array<Array<number>>} cache - A 2D array to cache computed values for dynamic programming.
10+
* @returns {number} The maximum value that can be stolen.
611
*/
712
const zeroOneKnapsack = (arr, n, cap, cache) => {
813
// Base Case: No capacity or no items

0 commit comments

Comments
 (0)