Think about an algorithm that checks the elements of a list to see if the items in the list are decreasing. So, for example, the list [34,8,6,2] should give True as the answer, and the list [4,8,1,33] should give False. Briefly describe how the algorithm processes the list. Your algorithm should end as soon as the answer is known. Note that you are not supposed to sort the list but to check to see if it is sorted already.
Provide your estimate of the algorithm's best and worst-case number of comparisons with an explanation justifying your analysis. Is this algorithm an examine-all algorithm or an all-pairs?