Exemplo n.º 1
0
 public CreateCoordList(bool[] numOfSorts, int[] numOfCells)
 {
     Coords      = new int[numOfSorts.Length, numOfCells.Length];
     listOfSorts = new CreateListOfSortings(numOfSorts);
     for (int i = 0; i < numOfCells.Length; i++)
     {
         if (numOfCells[i] != 0)
         {
             randArray = new RandomArrayGenerator(numOfCells[i]);
             for (int j = 0; j < numOfSorts.Length; j++)
             {
                 if (listOfSorts.Sorts[j] != null)
                 {
                     listOfSorts.Sorts[j].NotSortedArray = randArray.NotSortedArray;
                     listOfSorts.Sorts[j].N = randArray.NotSortedArray.Length;
                     Coords[j, i]           = (int)(listOfSorts.Sorts[j].timeToSort());
                     MessageBox.Show(listOfSorts.Sorts[j].Name + " " + Coords[j, i].ToString());
                     if (Coords[j, i] > max)
                     {
                         max = Coords[j, i];
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public ShakerSort(RandomArrayGenerator randArray)
 {
     Name           = "Shaiker";
     N              = randArray.N;
     NotSortedArray = new int[N];
     for (int i = 0; i < N; i++)
     {
         NotSortedArray[i] = randArray.NotSortedArray[i];
     }
 }
Exemplo n.º 3
0
 public BubbleSort(RandomArrayGenerator randArray)
 {
     Name           = "Bubble";
     N              = randArray.N;
     NotSortedArray = new int[N];
     for (int i = 0; i < N; i++)
     {
         NotSortedArray[i] = randArray.NotSortedArray[i];
     }
 }