This commit is contained in:
2025-03-04 15:53:39 +03:00
parent d3ac74eb64
commit bbf73e06a4
8 changed files with 95 additions and 0 deletions

16
DataLabs/lab1/swap.java Normal file
View File

@ -0,0 +1,16 @@
public class swap {
public static <T> void swap(T[] array, int i1, int i2) {
T temp = array[i1];
array[i1] = array[i2];
array[i2] = temp;
}
public static <T> void printArray(T[] array) {
for (T element: array) {
System.out.print(element + " ");
}
System.out.println();
}
}