#include using namespace std; struct Item { int weight; int profit; }; float profitPerUnit(Item x) { return (float)x.profit/(float)x.weight; } int partition (Item arr[], int low, int high) { Item pivot = arr[high]; // pivot int i = (low - 1); // Index of smaller element for (int j = low; j >capacity; cout<<"\n Enter the number of Items : "; int n; cin>>n; Item itemArray[n]; for (int i = 0; i < n; i++) { cout<<"\nEnter the weight and profit of item "<>itemArray[i].weight; cin>>itemArray[i].profit; } quickSort(itemArray, 0, n-1); // show(itemArray, n); float maxProfit=0; int i=n; while(capacity>0 && --i>=0) { if(capacity>=itemArray[i].weight) { maxProfit+=itemArray[i].profit; capacity-=itemArray[i].weight; cout<<"\n\t"<