# 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. 14. t : = 0 for i : = 1 to n s : = 0 for j : = 1 to i s : = s + a [ j ] next j t : = t + s 2 next i

### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
Publisher: Cengage Learning,
ISBN: 9781337694193

### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
Publisher: Cengage Learning,
ISBN: 9781337694193

#### Solutions

Chapter
Section
Chapter 11.3, Problem 14ES
Textbook Problem

## Expert Solution

### Want to see the full answer?

Check out a sample textbook solution.See solution

### Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Solution

*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.