ITeye博客

Algorithm

香水浓 · 2015-06-06 04:23 · algorithm · 编程语言 · Java · algorithm · Markdown

冒泡排序


	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;
				}
			}
		}

	}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。