Question

Task 2. Suppose you have the following algorithm:

1. As an input algorithm is given five (5) unsorted integer arrays of length n.

2. Each array is sorted using bubble sort.

3. Every element of 2nd and 4th array is output on the screen of a user.

4. Number 9 is added to 7th element of 1st, 3rd and 5th arrays.

Find how many steps it would take to execute this algorithm (Hint: it should look like equation). Prove that

time complexity of this algorithm is O(n²).