Finding the second smallest element with the minimum number of comparisons:
Let’s assume that the unordered sequence contains n elements. Then we can find the smallest element in n-1 comparisons.
We can do this by having a variable (let’s call it ‘minNum’), and storing the first value in it. …