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
Cambridge International AS & A Level Computer Science
ISBN: 9781510457591
1st Edition
Authors: David Watson, Helen Williams
Question Posted: