Worst-case number of comparisons for bubble sort on 8 items is:

  1. 16
  2. 28
  3. 8
  4. 64
Answer

B) 28

(n − 1) + … + 1 = n(n − 1)/2 = 28. SLO CS-11-B-02

Computer Science MCQ · More Unit 2: Computational Thinking and Algorithms MCQs · Practise