标签:c style class blog code java
package chap02_Basic_Algorithms; import static org.junit.Assert.*; import java.util.Arrays; import org.junit.Test; public class SortAlgorithms { /** * 冒泡法排序 * * @param n */ static void bubbleSort(int[] n) { int j = n.length - 1; int i; int tmp; while (j > 0) { i = 0; while (i < j) { if (n[i] > n[j]) { tmp = n[i]; n[i] = n[j]; n[j] = tmp; } i++; } j--; } } }
标签:c style class blog code java
原文地址:http://www.cnblogs.com/xiaojintao/p/3768823.html