private static void ReadVectorAndBubbleSort()
        {
            int[] array = ConsoleHelper.ReadArrayFromConsole("Array");

            int[] sortedArray = ArrayHelper.BubbleSort(array, SortDirection.Ascending);

            ConsoleHelper.PrintArray("Original Array", array);
            ConsoleHelper.PrintArray("Sorted Array", sortedArray);
        }
Ejemplo n.º 2
0
        public void ComparerSumByIncTest()
        {
            int[][] jaggedArray = new int[3][];
            jaggedArray[0] = new int[4] {
                1, 2, 3, 40
            };
            jaggedArray[2] = new int[6] {
                1, 2, 3, 4, -1, -2
            };

            int[][] expected = new int[3][];
            expected[0] = jaggedArray[2];
            expected[1] = jaggedArray[0];
            ArrayHelper.BubbleSort(jaggedArray, new ComparerSumByInc());

            CollectionAssert.AreEqual(expected, jaggedArray);
        }