Britannica Sources used in this answer

Why does selection sort have quadratic time complexity?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

Selection sort has quadratic time complexity, denoted as O(n2), because of the way it processes data to order a list. In this sorting algorithm, the procedure requires a pass through the list for every element present. During each of these passes, the algorithm must evaluate every remaining unsorted element to identify the minimum value.1

Because the number of operations required to find the minimum value grows in proportion to the length of the list (n), and the number of elements that must be processed also grows with n, the total number of operations scales with the square of the input size. Consequently, the time required to complete the sort increases quadratically as the list grows, making it significantly less efficient than algorithms with lower time complexity, such as those operating in O(nlogn) time.21