To sort in descending order with bubble sort, the comparison a[j] a[j+1] changes to:
- a[j] == a[j+1]
- a[j] = a[j+1]
- a[j] < a[j+1]
- it does not change
Answer
C) a[j] < a[j+1]
Swap when the left item is smaller, so larger values move to the front. SLO CS-11-B-02
Computer Science MCQ · More Unit 2: Computational Thinking and Algorithms MCQs · Practise