Describe in detail and in english the steps of an algorithm


a) Describe in detail (and in English) the steps of an algorithm that finds the maximum and minimum of a sequence of elements by examining pairs of successive elements, keeping track of a temporary maximum and a temporary minimum. If is odd, both the temporary maximum and temporary minimum should initially equal the first term, and if is even, the temporary minimum and temporary maximum should be found by comparing the initial two elements. The temporary maximum and temporary minimum should be updated by comparing them with the maximum and minimum of the pair of elements being examined.

b) Express the algorithm described in part (a) in pseudo code.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Describe in detail and in english the steps of an algorithm
Reference No:- TGS02248490

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)