int partition(bank *tab, int begin, int end) { int pivot = tab[end].suma_gotowki; int i = (begin - 1); for (int j = begin; j < end; j++) { if (tab[j].suma_gotowki <= pivot) { i++; swap(tab[i], tab[j]); } } swap(tab[i + 1], tab[end]); return i + 1; } void quickSort(bank *tab, int begin, int end) { if (begin < end) { int partitionIndex = partition(tab, begin, end); quickSort(tab, begin, partitionIndex - 1); quickSort(tab, partitionIndex + 1, end); } }