To sort in descending order with bubble sort, the comparison a[j] a[j+1] changes to:

  1. a[j] == a[j+1]
  2. a[j] = a[j+1]
  3. a[j] < a[j+1]
  4. 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