×
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.3 - Problem 24e
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.3 - Problem 24e

×

# An algorithm is called optimal for the solution of a ISBN: 9780073383095 37

## Solution for problem 24E Chapter 3.3

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 419 Reviews
26
4
Problem 24E

Problem 24E

An algorithm is called optimal for the solution of a problem with respect to a specified operation if there is no algorithm for solving this problem using fewer operations.

a) Show that Algorithm 1 in Section 3.1 is an optimal algorithm with respect to the number of comparisons of integers. [Note: Comparisons used for bookkeeping in the loop are not of concern here.]

b) Is the linear search algorithm optimal with respect to the number of comparisons of integers (not including comparisons used for bookkeeping in the loop)?

Step-by-Step Solution:

Solution

In this question,

a) We  have to show that as  mentioned in algorithm 1 in section 3.1 it is an optimal algorithm with respect to number of comparisons of integers (Comparisons used for bookkeeping in the loop are not of concern here).

b) Also if the linear search algorithm is optimal with respect to the number of comparisons of integers (not including comparisons used for bookkeeping in the loop)?

Step 1

a) As mentioned in the algorithm in section 3.1

It is algorithm for finding the maximum element in a finite sequence.

procedure max (   if then {max is the largest element}

Step 2 of 2

##### ISBN: 9780073383095

Unlock Textbook Solution