diff --git a/bin/lab12_sort/YSort.class b/bin/lab12_sort/YSort.class index dc0d1b5..bbed87c 100644 Binary files a/bin/lab12_sort/YSort.class and b/bin/lab12_sort/YSort.class differ diff --git a/src/lab12_sort/12-sort-FR-no_report.pdf b/src/lab12_sort/12-sort-FR-no_report.pdf new file mode 100644 index 0000000..afeeca6 Binary files /dev/null and b/src/lab12_sort/12-sort-FR-no_report.pdf differ diff --git a/src/lab12_sort/12-sort-FR.pdf b/src/lab12_sort/12-sort-FR.pdf deleted file mode 100644 index 1b03b49..0000000 Binary files a/src/lab12_sort/12-sort-FR.pdf and /dev/null differ diff --git a/src/lab12_sort/YSort.java b/src/lab12_sort/YSort.java index d0755fb..63384bd 100644 --- a/src/lab12_sort/YSort.java +++ b/src/lab12_sort/YSort.java @@ -1,56 +1,52 @@ package lab12_sort; -public class YSort {static public -int[ - - ] sort( /***("* ") - **/ - int KKJAaJY[] - ) - { +public class YSort { + static public int[] sort( /*** ("* ") **/ + int KKJAaJY[]) { if (KKJAaJY.length > 1) { - int - pps = KKJAaJY.length -/ 2;int ajskfd -= KKJAaJY.length - pps;int a[] = new int[pps]; int asAa[] = - new int[ajskfd];for (int i = 0; i < pps; i++)a[i] = /***** asjkdfasdf - asfjdkasldf - asdfjkasdf - -as*/KKJAaJY[i]; for(int i = pps;i < pps + - ajskfd; i++)asAa[i - - pps] = - KKJAaJY[i]; - a = sort(a);asAa = sort(asAa);int i - - = 0 - , -j -= 0, k = 0;while(a.length - != j && asAa.length -!= k) { - if (a[j] <= asAa[k]) {KKJAaJY[i] = a[j];i++;j++;}else{KKJAaJY[ - i - ] -= asAa[k] - ; i - ++; + int pps = KKJAaJY.length / 2; + int ajskfd = KKJAaJY.length - pps; + int a[] = new int[pps]; + int asAa[] = new int[ajskfd]; + for (int i = 0; i < pps; i++) + a[i] = /***** + * asjkdfasdf + * asfjdkasldf + * asdfjkasdf + * as + */ + KKJAaJY[i]; + for (int i = pps; i < pps + ajskfd; i++) + asAa[i - pps] = KKJAaJY[i]; + a = sort(a); + asAa = sort(asAa); + int i = 0, j = 0, k = 0; + while (a.length != j && asAa.length != k) { + if (a[j] <= asAa[k]) { + KKJAaJY[i] = a[j]; + i++; + j++; + } else { + KKJAaJY[i] = asAa[k]; + i++; k++; } - }while (a.length != j) { KKJAaJY[i] = a[j]; i++; - j++; - // } } -// -// + while (a.length != j) { + KKJAaJY[i] = a[j]; + i++; + j++; + // } + } + // + // while (asAa.length != k) { - KKJAaJY[i] = asAa[k -]; - i - ++ - ;k - ++; } + KKJAaJY[i] = asAa[k]; + i++; + k++; + } } - // - return KKJAaJY;} + // + return KKJAaJY; + } }