I have written the fractional knapsack problem with two algorithms (Greedy and dynamic programming algorithm) and I have to make a comparison between them .. I only made a comparison in terms of time and space complexity .. I have no idea about what additional factors can be used for making comparison between the two algorithms.. I hope that anyone could help me and provides me with any idea .
1 Answers
0
votes
Although the question is a bit broadly asked, different criteria for comparison might include:
- actual running time vs. instance quality, i.e. relative gap to an optimal solution
- implementation difficulty
As practical evaluation of algorithms is an involved subject, I suggest reading A Theoretician's Guide to the Experimental Analysis of Algorithms by Johnson to avoid some common pitfalls and misconceptions.
O(n log n)
time by sorting. – Codor