Can somebody please demonstrate for me a more efficient Cartesian product algorithm than the one I am using currently (assuming there is one). I\'ve looked around SO and go
I don't know how to write Java-like-Iterators in C#, but maybe you know and can transfer my solution from here to C# yourself.
It can be interesting if your combinations are too big to keep them completely in memory.
However, if you filter by attribute over the collection, you should filter before building the combination. Example:
If you have numbers from 1 to 1000 and random words and combine them, and then filter those combinations, where the number is divisible by 20 and the word starts with 'd', you could have 1000*(26*x)=26000*x combinations to search.
Or you filter the numbers first, which gives you 50 numbers, and (if equally distributed) 1 character, which are only 50*x elements in the end.