Click here to Skip to main content
15,894,362 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help with Random integers Array Pin
Robert Rohde9-May-06 6:21
Robert Rohde9-May-06 6:21 
GeneralRe: Help with Random integers Array Pin
eric_tran9-May-06 6:30
eric_tran9-May-06 6:30 
GeneralRe: Help with Random integers Array Pin
Wjousts9-May-06 7:14
Wjousts9-May-06 7:14 
GeneralRe: Help with Random integers Array Pin
Robert Rohde9-May-06 8:00
Robert Rohde9-May-06 8:00 
GeneralRe: Help with Random integers Array Pin
Wjousts9-May-06 8:08
Wjousts9-May-06 8:08 
GeneralRe: Help with Random integers Array Pin
Robert Rohde9-May-06 8:41
Robert Rohde9-May-06 8:41 
GeneralRe: Help with Random integers Array Pin
Rob Philpott10-May-06 0:37
Rob Philpott10-May-06 0:37 
AnswerRe: Help with Random integers Array Pin
Wjousts9-May-06 7:09
Wjousts9-May-06 7:09 
I've done something very similar several times (not as much as 100,000 though). The way I did it was this:

int[] myArray = new int[100000];
Random rnd = new Random();
ArrayList number = new ArrayList(100000);
for (int i=0; i<100000; i++)
{
    number.Add(i);
}
for (int i=0; i<100000; i++)
{
    int temp = rnd.Next(numbers.Count);
    myArray[i] = numbers[temp];
    numbers.RemoveAt(temp);
}

I populate an ArrayList with all the numbers and then randomly pull them out of the list and put them in my array. I don't know how efficient it'd be for 100,000 items though.
QuestionHow to change the color of scroll bar in c# desktop Application ? Pin
Jax_qqq9-May-06 5:22
Jax_qqq9-May-06 5:22 
QuestionHow to change the color of scroll bar in c# desktop Application ? Pin
Jax_qqq9-May-06 5:18
Jax_qqq9-May-06 5:18 
AnswerRe: How to change the color of scroll bar in c# desktop Application ? Pin
Josh Smith9-May-06 5:22
Josh Smith9-May-06 5:22 
Question[Localizable(true)] Pin
Soundman32.29-May-06 5:12
Soundman32.29-May-06 5:12 
AnswerRe: [Localizable(true)] Pin
Robert Rohde9-May-06 6:29
Robert Rohde9-May-06 6:29 
GeneralRe: [Localizable(true)] Pin
Soundman32.29-May-06 22:30
Soundman32.29-May-06 22:30 
QuestionC# to jar Pin
conemajstor9-May-06 4:44
conemajstor9-May-06 4:44 
AnswerRe: C# to jar Pin
Ravi Bhavnani9-May-06 4:50
professionalRavi Bhavnani9-May-06 4:50 
GeneralRe: C# to jar Pin
conemajstor9-May-06 4:52
conemajstor9-May-06 4:52 
GeneralRe: C# to jar Pin
Ravi Bhavnani9-May-06 6:58
professionalRavi Bhavnani9-May-06 6:58 
AnswerRe: C# to jar Pin
KrIstOfK9-May-06 5:00
KrIstOfK9-May-06 5:00 
GeneralRe: C# to jar Pin
conemajstor9-May-06 5:06
conemajstor9-May-06 5:06 
GeneralRe: C# to jar Pin
KrIstOfK9-May-06 5:09
KrIstOfK9-May-06 5:09 
GeneralRe: C# to jar Pin
conemajstor9-May-06 5:08
conemajstor9-May-06 5:08 
AnswerRe: C# to jar Pin
leppie9-May-06 13:22
leppie9-May-06 13:22 
QuestionHeader class question Pin
leckey9-May-06 4:41
leckey9-May-06 4:41 
AnswerRe: Header class question Pin
KrIstOfK9-May-06 4:51
KrIstOfK9-May-06 4:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.