given an array a[1]=10,a[2]=20,a[3]=30 anyone got an iterator that runs over all subsets. for example:
function show(lst) { print ""; for(i in lst ) print(i,lst[i]) }
forsubs("show", a) ==>
10
20
30
40
10, 20
10,30
20,30
10,20,30
given an array a[1]=10,a[2]=20,a[3]=30 anyone got an iterator that runs over all subsets. for example:
10
20
30
40
10, 20
10,30
20,30
10,20,30
given an array a[1]=10,a[2]=20,a[3]=30 anyone got an iterator that runs over all subsets. for example:Two fun algorithms, given in C, C++, etc. Easy to Gawk.
function show(lst) { print ""; for(i in lst ) print(i,lst[i]) }
forsubs("show", a) ==>
10
20
30
40
10, 20
10,30
20,30
10,20,30
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 228:28:24 |
Calls: | 6,624 |
Calls today: | 6 |
Files: | 12,171 |
Messages: | 5,318,992 |