Data is stored in the array NameList [1:10]. This data is to be sorted using a bubble

Question:

Data is stored in the array NameList [1:10]. This data is to be sorted using a bubble sort:

a) A special case is when NameList is already in order. The algorithm above is applied to this special case.
Explain how many iterations are carried out for each of the loops.

b) Rewrite the algorithm using pseudocode, to reduce the number of unnecessary comparisons.
Use the same variable names where appropriate.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: