×
×

# How many comparisons does the selection sort (see preamble ISBN: 9780073383095 37

## Solution for problem 34E 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 372 Reviews
20
3
Problem 34E

How many comparisons does the selection sort (see preamble to Exercise 41 in Section 3.1) use to sort n items? Use your answer to give a big-O estimate of the complexity of the selection sort in terms of number of comparisons for the selection sort.

Step-by-Step Solution:

Step 1</p>

In this problem, we are asked to write the number of comparisons used by the selection sort and then give a Big-O estimate of the complexity of the selection sort.

Step 2</p>

A selection sort contains 2 loops in its program each containing n searches.

The second loop is contained inside the first loop, thus each search in the first loop does n comparisons.

Therefore the total number of comparisons becomes .

Step 3 of 3

##### ISBN: 9780073383095

This textbook survival guide was created for the textbook: Discrete Mathematics and Its Applications, edition: 7. This full solution covers the following key subjects: sort, selection, Comparisons, use, items. This expansive textbook survival guide covers 101 chapters, and 4221 solutions. Discrete Mathematics and Its Applications was written by and is associated to the ISBN: 9780073383095. Since the solution to 34E from 3.3 chapter was answered, more than 759 students have viewed the full step-by-step answer. The answer to “How many comparisons does the selection sort (see preamble to Exercise 41 in Section 3.1) use to sort n items? Use your answer to give a big-O estimate of the complexity of the selection sort in terms of number of comparisons for the selection sort.” is broken down into a number of easy to follow steps, and 45 words. The full step-by-step solution to problem: 34E from chapter: 3.3 was answered by , our top Math solution expert on 06/21/17, 07:45AM.

Unlock Textbook Solution