private static void ShowConsoleResults(MaximumElementOfArray max, params int[][] arrays) { for (int i = 0; i < arrays.Length; i++) { FormatedWriteLine(arrays[i], max.Find(arrays[i])); } }
static void Main(string[] args) { var array = new int[] { 100, 6, 1000, -200, 15, 0, 99 }; Console.WriteLine(MaximumElementOfArray.SearchMaximum(array)); Console.ReadKey(); }
static void Main(string[] args) { double[] arrDoubles = {}; MaximumElementOfArray maximum = new MaximumElementOfArray(arrDoubles); Console.WriteLine(maximum.GetMaximum(0, arrDoubles.Length - 1)); Console.ReadKey(); }
static void TestArray(int[] array) { try { int length = (array == null) ? 0 : array.Length - 1; Console.WriteLine("Max: " + MaximumElementOfArray.FindMaximumElementOfArray(array, length).ToString()); Console.WriteLine(string.Join(",", array)); } catch { throw; } }
static void Main(string[] args) { var a = new int[] { 1, 2, 3, 4, 5 }; var b = new int[] { 999 }; var c = new int[] { 5, 4, 3, 2, 1 }; var d = new int[] { 1, 10, 2, 20, 3 }; var e = new int[] { 1, -10, 2, 3, -4 }; var max = new MaximumElementOfArray(); ShowConsoleResults(max, a, b, c, d, e); ReadKey(); }
static void Main(string[] args) { var arr = new[] { 10, 12, 5, 6, 20, 2, 1, 6, 6 }; Console.WriteLine("Max value: " + MaximumElementOfArray.GetMaxElementFromArray(arr, arr[0])); }