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: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:41:32 |
Calls: | 10,390 |
Calls today: | 1 |
Files: | 14,064 |
Messages: | 6,417,072 |