Note that there are some explanatory texts on larger screens.

plurals
  1. POtree algorithm implementation c#
    text
    copied!<p>I have some issues resolving an algorithm used to find all posible combinations taking elements from N diferents lists (where N>=2 &amp;&amp; N&lt;=7 -> this number is fixed and I can make a diferent method for each N). The problems goes as this: I have five dictionaries:</p> <pre><code>IDictionary&lt;int, MyEnum&gt; listOne; IDictionary&lt;int, MyEnum&gt; listTwo; IDictionary&lt;int, MyEnum&gt; listThree; IDictionary&lt;int, MyEnum&gt; listFour; IDictionary&lt;int, MyEnum&gt; listN; enum MyEnum { MyEnumOne, MyEnumTwo, MyEnumThree, MyEnumFour, MyEnumFive, MyEnumOther } </code></pre> <p>which can have any number of elements (not more than 100, and most of the time they will have between 32 and 64 elements) and where MyEnum is a simple name enum with some values.</p> <p>For each possible combination, I have some method which examinates the combination and checks if it satisfies some conditions,and if they are satisfied stores some data based on the combination.</p> <p>I have tried simple nested iterations using foreachs for each list, which as expected, take eons to run!</p> <p>Any help, as where I should start, what should I do, or event what I should not do will be more than welcome!, also if more info is needed, please feel free to ask!</p> <p><em>*</em>*EDIT: a combination, based on five lists as shown before would be, for example:</p> <pre><code>(MyEnumOne, MyEnumOne, MyEnumFour, MyEnumFive, MyEnumTwo) </code></pre> <p>and, as this combination, can appear several times (as MyEnumOne value can be many times on listOne, etc), I have to also, keep record of how many times does this combination happens.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload