Question 1 of 30
In a programming class, students are tasked with implementing a sorting algorithm to arrange a list of integers in ascending order. They decide to compare two algorithms: Bubble Sort and Selection Sort. The initial list of integers is [64, 34, 25, 12, 22, 11, 90]. After applying Bubble Sort, the students observe that the algorithm performs a total of 21 comparisons and 11 swaps. Meanwhile, they also analyze the performance of Selection Sort on the same list. How many comparisons does Selection Sort make in the worst-case scenario for a list of size $n$?
$\frac{n(n-1)}{2}$
$n^2$
$n(n-1)$
$n(n+1)$

Preparing for Microsoft 98-380 Introduction to Programming Using Block-Based Languages (Touch Develop)? Now land the interview.

73% of qualified candidates get rejected because of weak resumes. Build an ATS-optimized, recruiter-ready resume in under 5 minutes - free to start.

Build My Resume Free