Jump to content

Power set: Difference between revisions

m
Line 767:
=={{header|Icon}} and {{header|Unicon}}==
 
The two examples below show the similarities and differences between constructing an explicit representation of the solution, i.e. a set containing the powerset, and one using generators. The basic recursive algorithm is the same in each case, but wherever the first stores part of the result away, the second uses 'suspend' to immediateimmediately pass the result back to the caller. The caller may then decide to store the results in a set, a list, or dispose of each one as it appears.
 
===Set building===
342

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.