1. ?? ??(SelectSort)
?? ??: ??? ??? ??? ?? ? ?? ?? ? ?? ?? ???? ?? ?? ?? ???? ?? ???? ??? ?????. ? ?? ???? ??? ?? ? ?? ???? ??? ?? ???? ?? ? ?? ??? ???? ?? ?? ???? ?? ??? ???? ??? ?? ??? ? ????? ?????.
public class SelectSort { public static void selectSort(int[] array) { int i; int j; int temp; int flag; for (i = 0; i < array.length; i++) { temp = array[i]; flag = i; for (j = i + 1; j < array.length; j++) { if (array[j] < temp) { temp = array[j]; flag = j; } } if (flag != i) { array[flag] = array[i]; array[i] = temp; } } } public static void main(String[] args) { int[] a = { 5, 1, 9, 6, 7, 2, 8, 4, 3 }; selectSort(a); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + " "); } } }
2. InsertSort(InsertSort)
?? ??: ??? ??? ??? ?? ???? ? ?? ???? ??? ?? ???? ?? ??? ???? ??? ?? ??????. ?? ?? ? ?? ????? ???? ?? ?? ?? ???? ??? ??? ?? ???? ?? ???? ???? ??? ???? ??? ???? ?????.
public class InsertSort { public static void insertSort(int[] a) { if (a != null) { for (int i = 1; i < a.length; i++) { int temp = a[i]; int j = i; if (a[j - 1] > temp) { while (j >= 1 && a[j - 1] > temp) { a[j] = a[j - 1]; j--; } } a[j] = temp; } } } public static void main(String[] args) { int[] a = { 5, 1, 7, 2, 8, 4, 3, 9, 6 }; // int[] a =null; insertSort(a); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + " "); } } }
3. ?? ??(BubbleSort)
?? ??: ??? n ???? ?? ? ?? ????? ?? ??? ? ???? ?????. ?? ???? ?? ????? ?? ??? ????. ??? ?? ? ???? ?? n?? ??? ? ?? ? ???? n?? ??? ???? ??(n-1) ???? ?????. ? ?? ?? ?????? ??? ???? ??? ?? ??? ? ??? ?????.
public class BubbleSort { public static void bubbleSort(int array[]) { int temp = 0; int n = array.length; for (int i = n - 1; i >= 0; i--) { for (int j = 0; j < i; j++) { if (array[j] > array[j + 1]) { temp = array[j]; array[j] = array[j + 1]; array[j + 1] = temp; } } } } public static void main(String[] args) { int a[] = { 45, 1, 21, 17, 69, 99, 32 }; bubbleSort(a); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + " "); } } }
4. MergeSort(MergeSort)
?? ??: ?? ? ?? ?? ??? ???? ??? ???? ? ?? ??? ????. ? ?? ??? ? ?? ???? ???, ? ?? ???? ????, ????? ??? ??? ???? ??? ? ?? ???? ?? ? ? ??? ??? ?????. ??? ??? ??(? n? ???? ??)? ?? ?? ??? 1? ? ?? ??? ?? ???? ?? ???? ??? 2 ?? 1? n/2(???) ??? ?? ???? ????. ?? ???? 2?? ?????. , ??? ??? ??? ??? ??? ? ??? ?????.
public class MergeSort { public static void merge(int array[], int p, int q, int r) { int i, j, k, n1, n2; n1 = q - p + 1; n2 = r - q; int[] L = new int[n1]; int[] R = new int[n2]; for (i = 0, k = p; i < n1; i++, k++) L[i] = array[k]; for (i = 0, k = q + 1; i < n2; i++, k++) R[i] = array[k]; for (k = p, i = 0, j = 0; i < n1 && j < n2; k++) { if (L[i] > R[j]) { array[k] = L[i]; i++; } else { array[k] = R[j]; j++; } } if (i < n1) { for (j = i; j < n1; j++, k++) array[k] = L[j]; } if (j < n2) { for (i = j; i < n2; i++, k++) { array[k] = R[i]; } } } public static void mergeSort(int array[], int p, int r) { if (p < r) { int q = (p + r) / 2; mergeSort(array, p, q); mergeSort(array, q + 1, r); merge(array, p, q, r); } } public static void main(String[] args) { int a[] = { 5, 4, 9, 8, 7, 6, 0, 1, 3, 2 }; mergeSort(a, 0, a.length - 1); for (int j = 0; j < a.length; j++) { System.out.print(a[j] + " "); } } }
5. ?? ??(QuickSort)
?? ??: ??? ??? ??? ?? ? ?? ?? ??? ?? ? ?? ???? ? ???? ????, ? ??? ?? ???? ? ??? ?? ????? ????. ?? ?? ? ??? ???? ??? ??? ???? ????? ??? ????.
public class QuickSort { public static void sort(int array[], int low, int high) { int i, j; int index; if (low >= high) return; i = low; j = high; index = array[i]; while (i < j) { while (i < j && index <= array[j]) j--; if (i < j) array[i++] = array[j]; while (i < j && index > array[i]) i++; if (i < j) array[j--] = array[i]; } array[i] = index; sort(array, low, i - 1); sort(array, i + 1, high); } public static void quickSort(int array[]) { sort(array, 0, array.length - 1); } public static void main(String[] args) { int a[] = { 5, 8, 4, 6, 7, 1, 3, 9, 2 }; quickSort(a); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + " "); } } }
6. ? ??(ShellSort)
?? ??: ?? ??? ?? ??? ?? ?? ???? ????. ?? ???? ?? ?? ????? ?? ? ?? ???? ?? ?? ?? ??? ??? ? ??? ?? ???? "?????" ??? ? ????? ?? ??? ?? ?? ??? ?????.
public class ShellSort { public static void shellSort(int[] a) { int len = a.length; int i, j; int h; int temp; for (h = len / 2; h > 0; h = h / 2) { for (i = h; i < len; i++) { temp = a[i]; for (j = i - h; j >= 0; j -= h) { if (temp < a[j]) { a[j + h] = a[j]; } else break; } a[j + h] = temp; } } } public static void main(String[] args) { int a[] = { 5, 4, 9, 8, 7, 6, 0, 1, 3, 2 }; shellSort(a); for (int j = 0; j < a.length; j++) { System.out.print(a[j] + " "); } } }
7. ?? ? ??(MinHeapSort)
?? ??: ??? n?? ???? ?? ???? ??? ???? ????? ?????. ??? ?? ??? ?? ??? ??? ??? ?? ?? ??? ??? ?? ??? ??? ?????. ?? ?? (n-1) ??? ?? ?????. - ?? ??? ??? ??? ?? ?? ??? ??? ?? ?? ??? ??? ???? ???? ?? ?? ???? ????. ??? ?? ??? ??? ?? ??? ? ????? ?????. ? ?? ????, ? ???? ??? ??? ???? ?? ? ????.
public class MinHeapSort { public static void adjustMinHeap(int[] a, int pos, int len) { int temp; int child; for (temp = a[pos]; 2 * pos + 1 <= len; pos = child) { child = 2 * pos + 1; if (child < len && a[child] > a[child + 1]) child++; if (a[child] < temp) a[pos] = a[child]; else break; } a[pos] = temp; } public static void myMinHeapSort(int[] array) { int i; int len = array.length; for (i = len / 2 - 1; i >= 0; i--) { adjustMinHeap(array, i, len - 1); } for (i = len - 1; i >= 0; i--) { int tmp = array[0]; array[0] = array[i]; array[i] = tmp; adjustMinHeap(array, 0, i - 1); } } public static void main(String[] args) { int[] a = { 5, 4, 9, 8, 7, 6, 0, 1, 3, 2 }; myMinHeapSort(a); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + " "); } } }
? ?? ??? ??? ??? ??? ????? ??? ???? ?????. PHP ???? ?????!
????? ???? Java ?? ???? ? ?? ??? ?? ??? ??? PHP ??? ????? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Java? ??? ?? ??, ?? ? ??? (? : Projectreactor) ? Java19? ?? ???? ??? ??? ?????? ?????. 1. CompletableFuture? ?? ??? ?? ?? ??? ? ?? ??? ????? ?? ??????? ? ?? ??? ?????. 2. Projectreactor? ?? ? ??? ??? ???? ?? ???? ? ??? ???? ?? ? ?????? ?????. 3. ?? ???? ??? ??? ??? I/O ??? ? ??? ???? ?? ??? ????? ??? ???? ????. ? ???? ?? ??? ????? ??? ??? ??? ?? ??? ??? ?????? ???? ???? ?? ?? ??? ??????.

Java?? ??? ?? ?? ??? ???? ? ?????. ?? ???? ??? ?????. 1. ?? ?? ? ???? ??????? ?? ?? ?? ??? ???? ??? ?????. 2. ?? ??, ???, ??? ?? ?? ?? ???? ????? ?? ??? ??? ??? ?????. 3. ENUMMAP ? ENUMSET? ???? ?? ? ?? ???? ???? ??? ???? ? ?????? ?????. 4. ?? ?, ??? ?? ?? ??? ?? ????? ?? ??? ??? ?????.? ????? ?? ???? ????????. ??? ???? ???? ?? ??? ????? ??? ?? ? ??? ?? ?????? ???????.

Javanio? Java 1.4? ?? ? ??? IOAPI???. 1) ?? ? ??? ?????, 2) ??, ?? ? ??? ?? ?? ??, 3) ? ??? ??? ???? 4) ?? ??? ?? IO?? ? ????? ?????. 1) ? ?? IO? ??? ?? ??? ???, 2) ??? ??? ?? ???? ?????, 3) ???? ?????? ???? 4) ??? ?? ??? ?? ?? ? ??? ?????. 1) ??? ??/??? ??? ?? ?????, 2) ???? ???? ???? ?? ???? ???????. 3) ??? ??? ??? ???????.

?? ?? Java? ?? ???? ?? ? ? ? ????? ????, ? ??? ??? ??? ??? ???? ? ????. 1. ?? ?? hashcode () ???? ???? ?? ?? ???? ?? ??? ?? ?? ???? ?????. 2. ?? ??? ??? ?? ?? ???? ??? ??? ? ????. ?? ??? ?? ? ??? ??? ?????. JDK8 ? ?? ? ??? ?? ?? (?? ?? 8) ??? ????? ?? ???? ?? ? ??? ?????. 3. ??? ?? ???? ?? ???? ?? equals () ? hashcode () ???? ?? ???????. 4. ?? ?? ??? ???? ?????. ?? ?? ??? ???? ?? ?? (?? 0.75)? ??? ?? ? ???; 5. ?? ?? ??? ??? ??? Multithreaded?? Concu? ???????.

Java ??? ??? ???? ??? ??? ??? ?????, ???? ????, ?????? ??? ? ????. 1. ??? ????? ???? ??? ? ? ??? ?? ?? ????? ???? ? ???? ??????. 2. ???? ?? ?? ???? ??? ??? ???? ?? ?? ???? ??? ??? ? ????. 3. ???? ???? ??? ??? ?? ??? ?? ? ? ??????. 4. ?? ?? ?? ??? ? ??? ??? ?? ????? ?? ?? ??? ??? ? ????. 5. ??, ?? ?? ??, ?? ?? ?? ???, ????? ?? ?? ? ???? ??? ????? ??????.

Java? Singleton Design Pattern? ???? ??? ???? ? ?? ?? ??? ? ?? ??? ?? ??? ??? ???? ???? ?? ???? ?? ???? ???? ??? ?????. ?? ???? ??? ?????. 1. ?????, ? ????? ? ?? ??? ?? ? ?? ????, ?? ?? ??? ?? ??? ???? ?? ??? ?????. 2. ???-?? ??, ??? ?? ?? ?? ?? ??? ?? ?? ??? ???? ??? ???? ? ???? ?? ??? ????. 3. ??? ?? ?? ????? ?? ????? ??? ??? ?? ??? ? ??? ??? ?? ?? ????? ?????. 4. ?? ??? ???? ???, ??? ??? ? ?? ??? ???? ?? ??? ???? ??? ??? ?????. ?? ??? ?? ?? ?? ??? ??? ? ????.

?? ??? ??? ???? ???? ? ??? ?? ?? ???? ?? ? ????. 1. ??. ofnullable? null ??? ??? ???? ?????. ?? ??, ??? ?? ??? ? Orelse? ???? ???? ? ???? ??? ???? ?????. 2. ?? ?? ?? ???? ?? ?? ???? NPE? ???? ??? ??? ??? ???? ???? ???? ?????. 3. ??? ??? ???? ??? ? ???, ??? ???? ???? ?? ??? ?? ?????. ??? ??? ??? ???? ??? ??? Orelse? ?? ?????. 4. ?? ???? ??? ??? ?? ??? ??? ???? ???? ?? ???? ???? ???? ?? ??? ?? ????? NU? ?? ?????.

java.io.notserializableException? ????? ?? ?? ??? ??? ???? ?? ???? ??? ??? ?????? ???? ?? ? ??? ??? ??? ????? ???? ????. 1. ?? ???? ??? ??????. 2. ???? ?? ??? ?? ???? ??? ??? ?????????. 3. ??? ? ????? ?? ??? ??? ??????. 4. ?? ?? ?? ? ???? ? ??? ??? ??????. 5. ?????? ???? ?? ???? ??????. 6. ? ??? ?? ?? ??? ??? ?? ?? ??? ?? ??? ??? ???? ?? ??? ??????. 7. ??? ??????
