## 3 replies

Last post Apr 04, 2015 05:50 AM by gerrylowry

• krishprince

Member

12 Points

13 Posts

### Creating sorted list

Hi,

I need to store probability values of 36 combinations in sortedlist. so i have created 36 sortedlist.

Is it advicable to create that many sorted list or any other alternative is there.

Even though some time i dont want to be using all 36 sortedlist.

Thanks

C .net

• gerrylowry

Star

14297 Points

5880 Posts

### Re: Creating sorted list

unclear ... what are you asking?

does your list has 36 entries?

do you have 36 lists?

are the values always the same or do they change over time?

what is the source of the values?  pseudo-random numbers?  other numbers?

C .net

B-)  Gerry Lowry, Chief Training Architect, Paradigm Mentors Learning never ends... +1 705-999-9195 wasaga beach, ontario canada TIMTOWTDI =.there is more than one way to do it
• krishprince

Member

12 Points

13 Posts

### Re: Creating sorted list

Respected sir,

Here i am having 6 two dimensional double array  with the structure array[6,8]  this is for example i have given

```1[{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6}]

2[{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6}]

3[{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6}]

4[{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6}]

5[{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6}]

6[{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6},{1,2,2,59,7,8,9,6}]```

So at the run time i am  creating 36 sortedlist this  which i am using as weight for generating random value.

But not every time i need all 36 list as some time i need only 10 or 5. The values will not be changing.

What can i do ?which is the best approach?

Thanks

C .net

• gerrylowry

Star

14297 Points

5880 Posts

### Re: Creating sorted list

Just create the entire list ... why over complicate ... then use only the part(s) you need ...

you asked how to create the list in another post of yours, that post was answered here:  http://forums.asp.net/post/5882140.aspx

so little code is required to create the full list that you might as well just reuse the code already given at the above link.

Note:  it would be useful if you would tell use why you are doing whatever it is you are trying to achieve; it is difficult to answer with clarity when your motivation is unclear.