Ejemplo n.º 1
0
        public static long BubbleTime(float[] array, TimeType type) => BubbleAlgorithm.Time(array, type); //returns time

        /// <summary>
        /// Returns prepared message of duration in ticks.
        /// </summary>
        /// <param name="array">Float array to sort.</param>
        /// <param name="type">Type of returned duration.</param>
        public static string BubbleTimePrint(float[] array, TimeType type)
        {
            if (type == TimeType.Both)
            {
                return(string.Format("Bubble Sorting Duration: {0} Miliseconds / {1} Ticks.", BubbleAlgorithm.Time(array, TimeType.Miliseconds), BubbleAlgorithm.Time(array, TimeType.Ticks))); //returns preprepared messageof time
            }
            return(string.Format("Bubble Sorting Duration: {0} {1}", BubbleAlgorithm.Time(array, type), type == TimeType.Ticks ? "Ticks." : "Miliseconds."));                                   //returns preprepared message of time
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns duration of algorithm calculations in ticks.
 /// </summary>
 /// <param name="array">Flaot array to sort.</param>
 /// <param name="type">Type of returned duration.</param>
 public static long BubbleTime(float[] array, TimeType type) => BubbleAlgorithm.Time(array, type); //returns time