File tree Expand file tree Collapse file tree 1 file changed +21
-21
lines changed Expand file tree Collapse file tree 1 file changed +21
-21
lines changed Original file line number Diff line number Diff line change 3
3
#include < iostream>
4
4
5
5
// void Print(int res[20][20], int i, int j, int capacity)
6
- // {
7
- // if(i==0 || j==0)
8
- // {
9
- // return;
6
+ // {
7
+ // if(i==0 || j==0)
8
+ // {
9
+ // return;
10
10
// }
11
- // if(res[i-1][j]==res[i][j-1])
12
- // {
13
- // if(i<=capacity)
14
- // {
15
- // cout<<i<<" ";
16
- // }
11
+ // if(res[i-1][j]==res[i][j-1])
12
+ // {
13
+ // if(i<=capacity)
14
+ // {
15
+ // std:: cout<<i<<" ";
16
+ // }
17
17
//
18
- // Print(res, i-1, j-1, capacity-i);
19
- // }
20
- // else if(res[i-1][j]>res[i][j-1])
21
- // {
22
- // Print(res, i-1,j, capacity);
23
- // }
24
- // else if(res[i][j-1]>res[i-1][j])
25
- // {
26
- // Print(res, i,j-1, capacity);
27
- // }
28
- // }
18
+ // Print(res, i-1, j-1, capacity-i);
19
+ // }
20
+ // else if(res[i-1][j]>res[i][j-1])
21
+ // {
22
+ // Print(res, i-1,j, capacity);
23
+ // }
24
+ // else if(res[i][j-1]>res[i-1][j])
25
+ // {
26
+ // Print(res, i,j-1, capacity);
27
+ // }
28
+ // }
29
29
30
30
int Knapsack (int capacity, int n, int weight[], int value[]) {
31
31
int res[20 ][20 ];
You can’t perform that action at this time.
0 commit comments