To find both the minimum and maximum elements in an arbitrary array of n elements simultaneously, the optimal algorithm pairs up elements and compares them:
Compare elements in pairs: ⌊n/2⌋ comparisons.
Compare the larger elements with the current maximum: ⌈n/2⌉−1 comparisons.
Compare the smaller elements with the current minimum: ⌈n/2⌉−1 comparisons.
The optimal number of comparisons (the lowest upper bound t) is:
For even n: 1+23(n−2)=23n−2=3⌈n/2⌉−2
For odd n: 23(n−1)=3⌊n/2⌋
In all cases, for n≥2:
t=⌈23n⌉−2=3⌈2n⌉−2≤3⌈2n⌉ Also, since finding just the minimum requires n−1 comparisons and finding the maximum requires additional comparisons, we have t>n for n>2.
Thus, the correct inequality range is t>n and t≤3⌈2n⌉.
Hence, the correct option is (C).