public static void main(String[] args) {
		int n = 0, len = 0;
		Scanner scanner = new Scanner(System.in);
		int sortKind =0;
		while (true) {
			System.out.print("һȻ n:");
			n = scanner.nextInt();
			len = n;
			int array[] = new int[n];
			List<Integer> aList = new LinkedList<Integer>();
			while (n > 0) {
				aList.add(n--);
			}
			Collections.shuffle(aList);

			int i = 0;
			System.out.println("ɵΪ");
			for (Integer e : aList) {
				array[i] = e.intValue();
				System.out.printf("%5d ", array[i]);
				if ((MAXNUM - 1) == i % MAXNUM) {
					System.out.println();
				}
				i++;
			}
			System.out.println();
			System.out.println("ѡ㷨");
			System.out.println("1.ϲ");
			System.out.println("2.");
			System.out.println("3.ϣ");
			System.out.println("4.");
			System.out.println("5.ð");
			System.out.println("6.Ͱ");
			sortKind = scanner.nextInt();
			//sortKind = scanner.nextInt();
			long t =0;
			System.out.println("Ϊ");
			switch (sortKind) {
			case 1:
				t =mergeSort(array);
				//printArray(array);
				System.out.printf("Ϊ%dĺϲʱ%d ms\n", len, t);
				break;
			case 2:
				t =insertSort(array);
				//printArray(array);
				System.out.printf("Ϊ%dĲʱ%d ms\n", len, t);
				break;
			case 3:
				t =shellSort(array);
				//printArray(array);
				System.out.printf("Ϊ%dϣʱ%d ms\n", len, t);
				break;
			case 4:
				t =mergeSort(array);
				//printArray(array);
				System.out.printf("Ϊ%dĿʱ%d ms\n", len, t);
				break;
			case 5:
				t =bubbleSort(array);
				//printArray(array);
				System.out.printf("Ϊ%dðʱ%d ms\n", len, t);
				break;
			case 6:
				t =bucketSort(array);
				printArray(array);
				System.out.printf("Ϊ%dͰʱ%d ms\n", len, t);
				break;
			default:
				break;
			}
			
			
			//System.out.printf("Ϊ%dðʱ%d ms\n", len, bubbleSort(array));
			//System.out.printf("Ϊ%dĲʱ%d ms\n", len, insertSort(array));
			//System.out.printf("Ϊ%dĿʱ%d ms\n", len, quickSort(array));
			//System.out.printf("Ϊ%dĺϲʱ%d ms\n", len, mergeSort(array));
			//System.out.printf("Ϊ%dϣʱ%d ms\n", len, shellSort(array));
			//System.out.printf("Ϊ%dͰʱ%d ms\n", len, bucketSort(array));
			// t =bubbleSort(array);
			// t =insertSort(array);
			 //t =quickSort(array);
			//t =mergeSort(array);
			// t =shellSort(array);
			 //t =bucketSort(array);
			//printArray(array);
			//System.out.printf("Ϊ%dʱ%d ms\n", len, t);
		}
		// int array[] = { 3, 6, 7, 4, 1, 2, 5 };
	}