From f52296bb745b2afc779ca44167145a9dc86275c0 Mon Sep 17 00:00:00 2001 From: 299hm <2601626614@qq.com> Date: Wed, 10 Apr 2024 10:47:45 +0800 Subject: [PATCH 1/4] sub --- .idea/.gitignore | 8 ++++++++ .idea/compiler.xml | 13 +++++++++++++ .idea/encodings.xml | 7 +++++++ .idea/jarRepositories.xml | 20 ++++++++++++++++++++ .idea/libraries/untitled_1_0_SNAPSHOT.xml | 9 +++++++++ .idea/misc.xml | 14 ++++++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ .idea/web-framework.iml | 9 +++++++++ 9 files changed, 94 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/compiler.xml create mode 100644 .idea/encodings.xml create mode 100644 .idea/jarRepositories.xml create mode 100644 .idea/libraries/untitled_1_0_SNAPSHOT.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/web-framework.iml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..d9e3477 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..e7cd972 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/untitled_1_0_SNAPSHOT.xml b/.idea/libraries/untitled_1_0_SNAPSHOT.xml new file mode 100644 index 0000000..65dd37a --- /dev/null +++ b/.idea/libraries/untitled_1_0_SNAPSHOT.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0ac8b6d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..8e99870 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/web-framework.iml b/.idea/web-framework.iml new file mode 100644 index 0000000..d6ebd48 --- /dev/null +++ b/.idea/web-framework.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file -- Gitee From 865a1155abaffe19dd2488b586df0da3e8b9f7ac Mon Sep 17 00:00:00 2001 From: 299hm <2601626614@qq.com> Date: Wed, 10 Apr 2024 10:49:30 +0800 Subject: [PATCH 2/4] =?UTF-8?q?Maven=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/libraries/untitled_1_0_SNAPSHOT1.xml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .idea/libraries/untitled_1_0_SNAPSHOT1.xml diff --git a/.idea/libraries/untitled_1_0_SNAPSHOT1.xml b/.idea/libraries/untitled_1_0_SNAPSHOT1.xml new file mode 100644 index 0000000..91f3f50 --- /dev/null +++ b/.idea/libraries/untitled_1_0_SNAPSHOT1.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file -- Gitee From af4d44adeaece93c7e493c8efc4d278fbee45cfd Mon Sep 17 00:00:00 2001 From: 299hm <2601626614@qq.com> Date: Wed, 10 Apr 2024 11:10:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- a.txt | 1 + b.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 a.txt create mode 100644 b.txt diff --git a/a.txt b/a.txt new file mode 100644 index 0000000..71165b0 --- /dev/null +++ b/a.txt @@ -0,0 +1 @@ +bbbbb \ No newline at end of file diff --git a/b.txt b/b.txt new file mode 100644 index 0000000..71165b0 --- /dev/null +++ b/b.txt @@ -0,0 +1 @@ +bbbbb \ No newline at end of file -- Gitee From 5ab374cc7013213f440ea0269afd3ffaa13962b8 Mon Sep 17 00:00:00 2001 From: 299hm <2601626614@qq.com> Date: Wed, 10 Apr 2024 11:17:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=B0=E8=BF=9C=E7=A8=8B=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c.txt | 1 + untitled/src/test/java/SelectSortTest.java | 41 ++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 c.txt create mode 100644 untitled/src/test/java/SelectSortTest.java diff --git a/c.txt b/c.txt new file mode 100644 index 0000000..2383bd5 --- /dev/null +++ b/c.txt @@ -0,0 +1 @@ +ccc \ No newline at end of file diff --git a/untitled/src/test/java/SelectSortTest.java b/untitled/src/test/java/SelectSortTest.java new file mode 100644 index 0000000..3901180 --- /dev/null +++ b/untitled/src/test/java/SelectSortTest.java @@ -0,0 +1,41 @@ +import org.junit.Assert; +import org.junit.Test; +import static org.junit.Assert.*; +/** + * 测试方法 + */ +import java.util.Arrays; + +public class SelectSortTest { + public static void main(String[] args) { + int[] array = {10, 9, 8, 7, 6}; + int[] sortedArray = sort(array); + + System.out.println("Original Array: " + Arrays.toString(array)); + System.out.println("Sorted Array: " + Arrays.toString(sortedArray)); + } + public static int[] sort(int[] array) { + int i, j; + int len = array.length; + int[] copyArray = Arrays.copyOf(array, len); + int minIndex = 0; + + for (i = 0; i < len - 1; i++) { + minIndex = i; + for (j = i + 1; j < len; j++) { + if (copyArray[j] < copyArray[minIndex]) { + minIndex = j; + } + } + if (minIndex != i) { + swap(copyArray, i, minIndex); + } + } + return copyArray; + } + private static void swap(int[] array, int x, int y) { + int tmp = array[x]; + array[x] = array[y]; + array[y] = tmp; + } +} \ No newline at end of file -- Gitee