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.
Jump to Post
I don't understand what for C# code appeares here. There are a lots of insertion (and others) sort C codes in INET. For example, that's one from the excellent tutorial
All 9 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.