×
Log in to StudySoup
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.3 - Problem 24e
Join StudySoup for FREE
Get Full Access to Discrete Mathematics And Its Applications - 7 Edition - Chapter 3.3 - Problem 24e

Already have an account? Login here
×
Reset your password

An algorithm is called optimal for the solution of a

Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen 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 | ISBN: 9780073383095 | Authors: Kenneth Rosen

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

Chapter 3.3, Problem 24E is Solved
Textbook: Discrete Mathematics and Its Applications
Edition: 7
Author: Kenneth Rosen
ISBN: 9780073383095

Other solutions

People also purchased

Related chapters

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

An algorithm is called optimal for the solution of a