You are given as input n items, where item i has a positive real-valued weight wi and a positive integral value vi. You are also given a positive real-valued capacity W. Note that the weights need not be integral. Give a dynamic programming algorithm that returns the value of the subset of items with maximum total value subject to the total weight of the subset being at most W. (You do not have to construct the actual subset of items.) the running time of your algorithm, should be polynomial in the largest item value vmax = max vi and the number of items n.
If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...