I am trying to solve a typical 0/1 knapsack problem (using greedy algorithm). In this problem I have to sort a structure consisting of 2 ints (one that contains the value and their corresponding amount I have to minimize the value to get `n' amounts so i need to sort) I am not able to do so.Please help me out.
Please tell me if there exist any better coding method to solve greedy knapsack problem.
shankhs 0 Junior Poster in Training
shankhs 0 Junior Poster in Training
ddanbe 2,724 Professional Procrastinator Featured Poster
shankhs 0 Junior Poster in Training
ddanbe 2,724 Professional Procrastinator Featured Poster
ArkM 1,090 Postaholic
ddanbe 2,724 Professional Procrastinator Featured Poster
ArkM 1,090 Postaholic
ddanbe commented: Carry on with the good cause. You're right it was a slip of my tongue, it had to be C here and nothing else. +2
shankhs 0 Junior Poster in Training
ArkM 1,090 Postaholic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.