Given an array s =(s[1], s[2], . , s[n], and n = 2dfor some d 1. We want to findthe minimum and maximum values in s. We do this by comparing elements…