Abdul Manan posted a discussion

Abdul Manan posted a discussion

CS502 GDB Solution required

GDB Topic: There is a dynamic-programming algorithm for the 0/1 Knapsack problem that has a running time of O(nW), where n is the number of items, and W is the knapsack’s capacity. However, the Knapsack problem is also known to be NP-hard. The time complexity is clearly O(nW). It must be cautioned that as n and W get large, both time and space complexities become significant. However, it is assumed that 0/1 knapsack can also be solved using greedy algorithm which reduced its time complexity. As Greedy algorithm (non-optimal) takes O(k) time.In the context of dynamic programming and greedy approach, which approach would you prefer for the solution of 0/1 knapsack problem, Justify your answer with solid reasons.See More


from Latest Activity on Virtual University of Pakistan https://ift.tt/2Y7ODwP

0 comments:

Post a Comment