to see what happens when the the values of avail are chosen from considerably larger spacechange the call to fastmaxval in figure to valtaken fastmaxval(items finding solution now takes , , calls of fastmaxval when the number of items is to see what happens when the weights are chosen from an enormous spacewe can choose the possible weights from the positive reals rather than the positive integers to do thisreplace the lineitems append(item(str( )random randint( maxval)random randint( maxweight))in buildmanyitems by the line items append(item(str( )random randint( maxval)random randint( maxweight)*random random())don' hold your breath waiting for this last test to finish dynamic programming may be miraculous technique in the common sense of the word, but it is not capable of performing miracles in the liturgical sense dynamic programming and divide-and-conquer like divide-and-conquer algorithmsdynamic programming is based upon solving independent subproblems and then combining those solutions there arehoweversome important differences divide-and-conquer algorithms are based upon finding subproblems that are substantially smaller than the original problem for examplemerge sort works by dividing the problem size in half at each step in contrastdynamic programming involves solving problems that are only slightly smaller than the original problem for examplecomputing the th fibonacci number is not substantially smaller problem than computing the th fibonacci number another important distinction is that the efficiency of divide-and-conquer algorithms does not depend upon structuring the algorithm so that the same problems are solved repeatedly in contrastdynamic programming is efficient only when the number of distinct subproblems is significantly smaller than the total number of subproblems extraordinary and bringing welcome consequences