Laboratory work No. 2

Variant No. 221 Gorbuntsova A. 6212

Task No. 1:

1 - Selection sort
2 - Quick sort
3 - Natural merge sort

Task No. 2:

Calculate the number of comparisons and the number of object copies for arrays of length 1 000, 2 000, 3 000, ..., 10 000, 25 000, 50 000, 50 000, 100 000:

a) on average (generate 100 random arrays and calculate average values);
b) for a completely sorted array;
c) for inversely sorted array.

Sort