Recent questions tagged selection-sort

1.9k
views
2 answers
2 votes
Consider the following code which sort all elements of an array A' in descending order.Which of the following will represents correct value of X, Y, Z in ... it is aranging in ascending order.And option D is doing what question is saying.
788
views
2 answers
0 votes
a. i>0,K>0, a[K]> a[max]b. i>0,K<0, a[K]< a[max]c. i<0,K>0, a[K]> a[max]d. i>0,K>0, a[K]< a[max]
803
views
1 answers
1 votes
Why option (A) is not correct ?
10.0k
views
3 answers
8 votes
How many comparisons are needed to sort an array of length $5$ if a straight selection sort is used and array is already in the opposite order?$1$10$15$20$
10.4k
views
2 answers
37 votes
Which one of the following is the tightest upper bound that represents the number of swaps required to sort $n$ numbers using selection sort?$O(\log n$)$O(n$)$O(n \log n$)$O(n^{2}$)
28.3k
views
2 answers
30 votes
What is the number of swaps required to sort $n$ elements using selection sort, in the worst case?$\Theta(n)$\Theta(n \log n)$\Theta(n^2)$\Theta(n^2 \log n)$
To see more, click for the full list of questions or popular tags.