public class Test { public static void main(String[] args) { int a[] = { 1, 2, 3, 4, 5 }; 选择排序(a); // 插入排序(a); System.out.print("排序后:"); for (int n : a) { System.out.print(n + " "); } } static void 选择排序(int[] a) { for (int i = 0; i &…
//快速排序: #include <stdio.h> #define MAX 500000 int s[MAX]; void Q_Sort(int start,int end) { int i,j,t; if ( start >= end ) return ; t = s[start]; i = start; j = end; while ( i < j) { while ( s[j] >= t && i < j) { j--; } s[i] = s[j…