示例#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];
                     }
                 }
             }
         }
     }
 }
示例#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];
     }
 }
示例#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];
     }
 }