   Chapter 11.3, Problem 6ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# For each of the algorithm segments in 6—19, assume that n is a positive integer. (a) Compute the actual number of elementary operations (additions, subtractions, multiplications, divisions, and comparisons) that are performed when the algorithm segment is executed. For simplicity, however, count only comparisons that occur within if then statements; ignore those implied by for-next loops. (b) Use the theorem on polynomial orders to find an order for the algorithm segment.6. for i : = 3 to n − 1 a : = 3 ⋅ n + 2 ⋅ i − 1 next i

To determine

(a)

The computation of actual number of elementary operations performed.

Explanation

This algorithm segment has just one loop which goes from 3 to (n1) and so there are as many iterations of the loop as there are integers from 3 to (n1), namely (n1)3+1=(n3)

To determine

(b)

An order for the given algorithm segment.

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started 