Algorithm

冒泡排序
	public static void sort(Integer[] param) {
		for (int i = param.length - 1; i > 0; i--) {
			for (int j = 0; j < i; j++) {
				int current = param[j];
				int next = param[j + 1];
				if (current > next) {
					param[j] = next;
					param[j + 1] = current;
				}
			}
		}

	}

你可能感兴趣的:(java,Algorithm)