mardi 7 juin 2016

Generate random v shaped int array in c#

I have to generate v shaped, ascending and descending random int array for sorting tests. I have no idea how to achive that. Here is my implementation for 100k array of random ints.

        Random rnd = new Random(Guid.NewGuid().GetHashCode());            
        int[] array = new int[100000];

        for (int i = 0; i < 100000; i++)
        {
            array[i] = rnd.Next(100000);
        }

Can somebody help me?




Aucun commentaire:

Enregistrer un commentaire