#include <stdio.h>void DisplayArray(int *pArray, int nLen){ for (int i = 0; i < nLen; ++i) { printf("array[%d] = %dn", i, pArray[i]); }}// pArray1和pArray2是已经排好序的数组,要
public class SelectSort { public static void main(String [] args){ int [] a = {1,52,3,21,541,122,321}; for(int i = 0; i < a.length; i++){ int idx = i; for(int j = i+1; j < a.length ; j++){ if (
public class InsertSort { public static void main(String [] args){ int [] a = {1,52,3,21,541,122,321}; for(int i = 1; i < a.length; i++){ for(int j = 0; j < i ; j++){ if ( a[i] < a[j]){ a[i]