static void Main() { // Console.WriteLine("Please type the numbers you want to be sorted separated by a comma and press enter"); // string preSplitDataToSort = Console.ReadLine(); //string [] splitDataToSort = preSplitDataToSort.Split(','); //int[] dataToSort = Array.ConvertAll(splitDataToSort, int.Parse); int[] dataToSort = { 23, 56, 34, 34, 5645, 57, 34, 1423, 45, 2345, 234, 244, 678, 76, 65, 347, 86, 658 }; clsSort cls = new clsSort(dataToSort); cls.quickSort(0, dataToSort.Length - 1); }
private void btnSort_Click(object sender, EventArgs e) { int i; clsSort mySort = new clsSort(data); mySort.quickSort(0, data.Length - 1); for (i = 0; i < data.Length; i++) { lstSorted.Items.Add(data[i].ToString()); } }