×
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.se - Problem 6e
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.se - Problem 6e

×

# a) Describe in detail (and in English) the steps of an

ISBN: 9780073383095 37

## Solution for problem 6E Chapter 3.SE

Discrete Mathematics and Its Applications | 7th Edition

• Textbook Solutions
• 2901 Step-by-step solutions solved by professors and subject experts
• Get 24/7 help from StudySoup virtual teaching assistants

Discrete Mathematics and Its Applications | 7th Edition

4 5 1 322 Reviews
19
4
Problem 6E

a) Describe in detail (and in English) the steps of an algorithm that finds the maximum and minimum of a sequence of n elements by examining pairs of successive elements, keeping track of a temporary maximum and a temporary minimum. If n is odd both the temporary maximum and temporary minimum should initially equal the first term, and if n 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 pseudocode.________________c) How many comparisons of elements of the sequence arc carried out by this algorithm? (Do not count comparisons used to determine whether the end of the sequence has been reached.) How does this compare to the number of comparisons used by the algorithm in Exercise 5?

Step-by-Step Solution:

Solution:Step 1:a). We have to describe an algorithm that finds the maximum and minimum of a sequence of n elements by examining pairs of successive elements, keeping track of a temporary maximum and a temporary minimum.

Step 2 of 5

Step 3 of 5

##### ISBN: 9780073383095

This textbook survival guide was created for the textbook: Discrete Mathematics and Its Applications, edition: 7. Since the solution to 6E from 3.SE chapter was answered, more than 404 students have viewed the full step-by-step answer. Discrete Mathematics and Its Applications was written by and is associated to the ISBN: 9780073383095. The full step-by-step solution to problem: 6E from chapter: 3.SE was answered by , our top Math solution expert on 06/21/17, 07:45AM. The answer to “a) Describe in detail (and in English) the steps of an algorithm that finds the maximum and minimum of a sequence of n elements by examining pairs of successive elements, keeping track of a temporary maximum and a temporary minimum. If n is odd both the temporary maximum and temporary minimum should initially equal the first term, and if n 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 pseudocode.________________c) How many comparisons of elements of the sequence arc carried out by this algorithm? (Do not count comparisons used to determine whether the end of the sequence has been reached.) How does this compare to the number of comparisons used by the algorithm in Exercise 5?” is broken down into a number of easy to follow steps, and 156 words. This full solution covers the following key subjects: temporary, maximum, minimum, elements, Algorithm. This expansive textbook survival guide covers 101 chapters, and 4221 solutions.

#### Related chapters

Unlock Textbook Solution