Prints the items which are put in a knapsack of capacity W
function printknapSack ( W , wt , val , n ) { let i , w ; let K = new Array ( n + 1 ) ; for ( i = 0 ; i < K . length ; i ++ ) { K [ i ] = new Array ( W + 1 ) ; for ( let j = 0 ; j < W + 1 ; j ++ ) { K [ i ] [ j ] = 0 ; } }