package org.example; public class Sorter { private int[] array; public Sorter(int[] array) { this.array = array; } public String printArray() { String text = ""; for (int item: array) { text += item + ", "; } text = text.substring(0, text.length()-2); return text; } public void bubbleSort() { for (int i = 0; i array[j+1]){ int a = array[j]; array[j] = array[j+1]; array[j+1] = a; } } } } public void insertionSort() { for (int i = 1; i< array.length; i++) { int k = array[i]; int j = i-1; while(j >= 0 && array[j]>k) { array[j+1] = array[j]; j--; } array[j] = k; } } public void selectionSort() { for (int i = 0; i< array.length - 1; i++){ int minValueIndex = i; for (int j = i+1; j