Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
easy

Sorting Error Analysis

Mark
< Prev
Next >

A student has written a sorting algorithm for a media project to organize image file sizes in ascending order. The student tests the algorithm using three different lists of file sizes. The following table summarizes the test results.

The student wants to ensure the algorithm works correctly for all possible inputs.

Test Case Input (KB) Output (KB)
1 10, 5, 20 5, 10, 20
2 100, 50, 100 50, 100, 100
3 15, 25, 5 25, 15, 5

Based on the table, which of the following is true regarding the student’s testing process?

A

The error in Test Case 3 indicates that the algorithm is not sorting the list in ascending order.

B

The test cases show that the algorithm only works if the input contains exactly three elements.

C

The algorithm is verified as error-free because it produced a correct output for the majority of the test cases.

D

The algorithm is proven correct for all possible inputs because it passed Test Case 1 and Test Case 2.

Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|