using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsolePractice { class CArray { private int[] arr; //数组大小 private int upper; //下标 private int numElements; /// <summary> /…
1.选择排序: //改进后的选择排序,减少交换的次数 public static void sortSelect(int arr[]) { //用于存放最小数的下标 int s; for (int i = 0; i < arr.length; i++) { s = i; for (int j = i + 1; j < arr.length; j++) { if (arr[s] > arr[j]) { //记录最小值的下标值 s = j; } } //如果最小数的下标值改变,则交换 if…