package bianchengti; /* * 在由N个元素构成的集合S中,找出最小元素C,满足C=A-B, * 其中A,B是都集合S中的元素,没找到则返回-1 */ public class findMinValue { //快速排序 public static void sort(int a[], int low, int hight) { if (low > hight) { return; } int i, j, key; i = low; j = hight; key = a[i]
/** * 找出未出现的最小正整数 * @param A * @param n * @date 2016-10-7 * @author shaobn */ public static int findArrayMex(int[] a,int n){ int count = n; int temp = 0; int dir = 1; int num = 0; for(int i = 0;i<count-1;i++){ if(a[i]>a[i+1]){ temp = a[i]; a[i]= a[i