java 實現冒泡排序

public class Bubble { public static void main(String[] args) { int[] a = { 5, 7, 9, 2, 4, 365, 65536, 6, 34, 421, 2, 14, 51, 57, 90, 7 }; // 遍歷數組 將相鄰的兩個元素比較 左邊的元素大於右邊的元素就交換位置 //首先進行內部遍歷 可視爲第一次遍歷 將
相關文章
相關標籤/搜索