diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..13566b81b018ad684f3a35fee301741b2734c8f4 --- /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 0000000000000000000000000000000000000000..d9e3477add1ad81e9f61334036a0d521f39da270 --- /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 0000000000000000000000000000000000000000..e7cd9726ce67b5f982145c5b15a31b82afd02dd8 --- /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 0000000000000000000000000000000000000000..712ab9d985c20018a0c97b93d2148ac1ffe588a5 --- /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 0000000000000000000000000000000000000000..65dd37abca7fae4b366937b755434b41915ae248 --- /dev/null +++ b/.idea/libraries/untitled_1_0_SNAPSHOT.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/libraries/untitled_1_0_SNAPSHOT1.xml b/.idea/libraries/untitled_1_0_SNAPSHOT1.xml new file mode 100644 index 0000000000000000000000000000000000000000..91f3f50bc5ca54ef7f64d52f7afff0caa29ac6f5 --- /dev/null +++ b/.idea/libraries/untitled_1_0_SNAPSHOT1.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 0000000000000000000000000000000000000000..0ac8b6de4df16e8000ab60481eb22e1e3f341ca8 --- /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 0000000000000000000000000000000000000000..8e9987035052f276318390db9534dbdd425b2905 --- /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 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /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 0000000000000000000000000000000000000000..d6ebd4805981b8400db3e3291c74a743fef9a824 --- /dev/null +++ b/.idea/web-framework.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/a.txt b/a.txt new file mode 100644 index 0000000000000000000000000000000000000000..71165b066ad762f608901c937bca51e26da322b5 --- /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 0000000000000000000000000000000000000000..71165b066ad762f608901c937bca51e26da322b5 --- /dev/null +++ b/b.txt @@ -0,0 +1 @@ +bbbbb \ No newline at end of file diff --git a/c.txt b/c.txt new file mode 100644 index 0000000000000000000000000000000000000000..2383bd587474492050db93523ca1bb4faf7773a0 --- /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 0000000000000000000000000000000000000000..390118023b0fe5a3187bac334d23584088ddf642 --- /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