From de75227c38d67674f4fd7fde3a698d0efc398a45 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 25 Oct 2022 20:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=92=E5=BA=8F=E5=A4=A7?= =?UTF-8?q?=E5=A6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codes/9955277.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 codes/9955277.java diff --git a/codes/9955277.java b/codes/9955277.java new file mode 100644 index 000000000..951278d33 --- /dev/null +++ b/codes/9955277.java @@ -0,0 +1,18 @@ +/** + * 冒泡排序函数 + * aa bb cc + * @param a 待排序的数组 + * @param n 待排序的数组长度 + */ +public static void bubbleSort(int [] a, int n){ + // 你的代码,使无序数组 a 变得有序 + for(int i=0;i array[j+1]){ + int temp = array[j]; + array[j] = array[j+1]; + array[j+1] = temp; + } + } + } +} //end -- Gitee