Knapsack problem/Continuous: Difference between revisions

Content added Content deleted
m (→‎version 1: commented about the program's pedigree.)
m (→‎version 1: changed comment about sort method.)
Line 1,945: Line 1,945:
totW=0; totV=0 /*set weight & value totals to 0.*/
totW=0; totV=0 /*set weight & value totals to 0.*/
call show 'unsorted item list' /*display a header and the @ list*/
call show 'unsorted item list' /*display a header and the @ list*/
/*for short lists, method is ok. */
/* [↓] sort is OK for short lists*/
do sorts=2 to items /*sort by desending value/unit wt*/
do sorts=2 to items /*sort by desending value/unit wt*/
_n=n.sorts; _w=w.sorts; _v=v.sorts /*calc. placeholders for DO loop.*/
_n=n.sorts; _w=w.sorts; _v=v.sorts /*calc. placeholders for DO loop.*/