1)

The key to solving this problem is computing the maximum size set of
inputs L such that for any two inputs in L there is a different answer
for the minimum and/or maximum value.  A good way to represent the
answer here is the index of the array where the max element is located
and the index of the array where the min element is located.  There
are n possibilities for the index of the array where the maximum
value occurs.  Then there are n-1 possibilities for which of the
remaining elements holds the minimum value.  For each of these
n(n-1) inputs, the answer is different because pairwise they either
have a differnt min, a different max, or both the min and max are
different.  

Since a decision tree of height h has at most 2^h leaves, it follows
that h must be large enough so that 2^h >= n(n-1).  Taking base-2
logarithms of both sides yields we must have h >= log_2 n(n-1) = log_2
n + log_2 (n-1) >= 2 log_2 (n-1).

Hence any comparison-based algorithm for this problem must make at least
2 log_2 (n-1) comparisons and hence has time complexity at least 2 log_2 (n-1).





















































2)

The key to solving this problem is computing how many different inputs
there are such that pairwise they have different answers for the given
problem.  We do this by counting all the possiblities for
how the 2 elements are merged into the n elements.  There are n+1 slots
(before the first element of A, after the first element of A, ...., after
the last element of A).  Hence there are C(n+1,2) = n(n+1)/2 ways in which
the two elements fall in different slots (their orderis fixed since they
were sorted) and n+1 ways in which they fall into the same slot.  Hence
by the sum rule, there are n(n+1)/2 + (n+1) = (n+1)(n+2)/2 possibilities.
Hence there must be at least (n+1)(n+2)/2 leaves.

Since a decision tree of height h has at most 2^h leaves, it follows
that h must be large enough so that 2^h >= (n+1)(n+2)/2.  Taking
base-2 logarithms of both sides yields we must have

    h >= log_2 (n+1)(n+2)/2 = log_2 (n+1) + log_2 (n+2) -1 >= 2 log_2 (n+1) - 1.

Hence any comparison-based algorithm for this problem must make at least
2 log_2 (n+1) - 1 comparisons and hence have time complexity >= 2 log_2 (n+1) - 1.