How many comparisons and interchanges (in terms of
file size n) are performed by Simple insertion sort
for the following files:
i) A file x of size n in which x[0], x[2],
x[4]... are the smallest elements in sorted order, and in which
x[1], x[3], x[5]... are the largest elements in sorted order, e.g.
[
3 14 5 15 9 18 11
19 ]
How many comparisons and interchanges (in terms of
file size n) are performed by Shell Sort using
increments 2 and 1 for the following files:
i) A file x of size n in which x[0], x[2],
x[4]... are the smallest elements in sorted order, and in which
x[1], x[3], x[5]... are the largest elements in sorted order,
e.g. [
3 14 5 15 9 18 11 19 ].