Question: Suppose the selection sort is modified so that both the smallest and the largest elements in the array are found on each pass. This means

Suppose the selection sort is modified so that both the smallest and the largest elements in the array are found on each pass. This means that if the array is size n, the number of elements remaining to be sorted at the next step is (n-2) instead of n-1 in the normal algorithm. What is the order of complexity of this new selection sort algorithm?
Question 10 options:
O(n(n-1))
O(n2)
O(n)
O(1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!