[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Attn Maths gurus....array algorithm needed



PureBytes Links

Trading Reference Links

Hi all

I need an algorithm to analyse an array.
Lets say i have an array called X and in it, it has 3 members like this
1,2,3.
i want everypossible combination of this ie

1
2
3
1,2
1,3
2,3
1,2,3

Simple? ummmmm maybe ... but my array isnt going to be a fixed length...
sometimes 2 members sometimes 10 members ie
here is the results with array called Y and it it it has 5 members 1,2,3,4,5

1
2
3
4
5
1,2
1,3
1,4
1,5
2,3
2,4
2,5
3,4
3,5
4,5
1,2,3
1,2,4
1,2,5
etc etc
up to 1,2,3,4,5

i think i may have asked something like this before ...but since then my
brain has been reformatted ...any suggestions
:O)

Cheers
Cameron
---