Exercise Lab9 WhiteBoxTesting Practice
Exercise Lab9 WhiteBoxTesting Practice
Class:
Bubble Sort is a simple-minded algorithm based on the idea that we look at the list, and
wherever we find two consecutive elements out of order, we swap them. We do this as
follows: We repeatedly traverse the unsorted part of the array, comparing consecutive
elements, and we interchange them when they are out of order. The name of the
algorithm refers to the fact that the largest element "sinks" to the bottom and the smaller
elements "float" to the top.
For I = 0 to N - 2
For J = 0 to N - 2
If (A(J) > A(J + 1)
Temp = A(J)
A(J) = A(J + 1)
A(J + 1) = Temp
End-If
End-For
End-For
YOUR SOLUTION:
1. Requirement 1:
2. Requirement 2: