Q2: (Exercise 2.2-2. From the Book) Consider sorting n numbers stored in array A by first finding the
smallest element of A and exchanging it with A[1]. Then find the second smallest element and
exchange it with A[2], etc.
[2 Marks]
a) Write pseudocode for this algorithm, which is known as selection sort.
b) Drive the general running time function, T(n), of the algorithm of the pseudocode you wrote on
(a) above (put the Cost and Time in a table format).
c) What are the worst-case running time (Justify)? And What is its classification in \(\Theta\) notation.