Sorting Error Analysis
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?
The error in Test Case 3 indicates that the algorithm is not sorting the list in ascending order.
The test cases show that the algorithm only works if the input contains exactly three elements.
The algorithm is verified as error-free because it produced a correct output for the majority of the test cases.
The algorithm is proven correct for all possible inputs because it passed Test Case 1 and Test Case 2.
Question Leaderboard
Not enough data yet to show leaderboard.
