MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/recursion/0-1 Knapsack.cpp:28–42  ·  view source on GitHub ↗

Driver code

Source from the content-addressed store, hash-verified

26
27// Driver code
28int main()
29{
30 int n , W;
31 cout<<"Enter the number of items";
32 cin>>n; // taking input n
33 vector<int> val(n) , wt(n);
34 for(int i = 0 ; i < n ; i++)
35 cin>>wt[i];
36 for(int i = 0 ; i < n ; i++)
37 cin>>val[i];
38 cout<<"Enter the capacity of knapsack";
39 cin>>W; //W of knapsack
40 cout << knapSack(W, wt, val, n);
41 return 0;
42}

Callers

nothing calls this directly

Calls 1

knapSackFunction · 0.85

Tested by

no test coverage detected