示例#1
0
        public void BubbleTest()
        {
            Initialize();
            var bubble = new BubbleAlgorithm(Items.ToArray());

            bubble.Sort(cancellationTokenSource.Token);

            var collection = bubble.GetCollection();

            for (int i = 0; i < bubble.CollectionSize; i++)
            {
                Assert.AreEqual(Sorted[i], collection[i]);
            }
        }
示例#2
0
 /// <summary>
 /// Sorting an double array with using bubble algorithm.
 /// </summary>
 /// <param name="array">Double array to sort.</param>
 public static void Bubble(double[] array) => BubbleAlgorithm.Sort(array);
示例#3
0
 /// <summary>
 /// Sorting an float array with using bubble algorithm.
 /// </summary>
 /// <param name="array">Float array to sort.</param>
 public static void Bubble(float[] array) => BubbleAlgorithm.Sort(array);