Subset sum problem: Difference between revisions
Content added Content deleted
m (→version 2: reduced a muddled over-reduntant wording. -- ~~~~) |
m (→version 1: change a word to make the OUTPUT section clearer. -- ~~~~) |
||
Line 612: | Line 612: | ||
return 0</lang> |
return 0</lang> |
||
'''output''' when using the input of: <tt> 0 100 </tt> |
'''output''' when using the input of: <tt> 0 100 </tt> |
||
<br>(The above arguments set the target sum to zero and limits finding |
<br>(The above arguments set the target sum to zero and limits finding of solutions to one hundred.) |
||
<br>This output was produced with a version of the REXX program that included the weights with the name. |
<br>This output was produced with a version of the REXX program that included the weights with the name. |
||
<br>The REXX statement used was: /*weights in this one───> */ names=names @._ '{'#._"}" |
<br>The REXX statement used was: /*weights in this one───> */ names=names @._ '{'#._"}" |
||
Line 746: | Line 746: | ||
Stopped after finding 100 subsets. |
Stopped after finding 100 subsets. |
||
</pre> |
</pre> |
||
===version 2=== |
===version 2=== |
||
This version requires the data to be in ascending order (by weight). |
This version requires the data to be in ascending order (by weight). |