Worst-case number of comparisons for bubble sort on 8 items is:
- 16
- 28
- 8
- 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
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