Simple and brute force approach :
Since, we have 100 elements and initially min=max=0, first two elements are chosen and compare them and update the value of min and max. So, 1 comparison here.
For the next 2 elements, we’ve to compare them first, then the minimum value from them is compared to min, similarly the maximum value from them is compared to max. Therefore, 3 comparisons are required.
Similarly, for the next 2 elements, 3 comparisons are required.
We can observe a pattern here like
2 elements → 3 comparisons
4 elements → 6 comparisons
.
.
.
98 elements → 98*(3/2) = 147 comparisons
(98 here because first two elements are compared once, and we started comparing 3 times from the third element. So, 3rd and 4th element constitute 2 elements, similarly, 3rd,4th,5th and 6th constitute 4 elements and so on.)
Therefore, total number of comparisons = 147 + 1 = 148
(1 is added because first two elements are compared once at beginning)