Alorithms · Class 12 · CBSE · Science Computer Science
What is the array after the first complete pass of selection sort in ascending order on [29, 10, 14, 37, 13]?
Practice question from Alorithms (Class 12 · CBSE · Science Computer Science), with the correct answer and a step-by-step solution.
easy · MCQ · Q-D77CE7
What is the array after the first complete pass of selection sort in ascending order on [29, 10, 14, 37, 13]?
- A.[10, 29, 14, 37, 13]Correct answer
- B.[29, 10, 13, 37, 14]
- C.[10, 14, 13, 29, 37]
- D.[13, 10, 14, 37, 29]
Solution
In the first pass of selection sort, the smallest element in the entire unsorted portion is selected and swapped with the first element. The smallest value is 10, so the array becomes [10, 29, 14, 37, 13].
More from Alorithms
- Which condition is necessary before applying binary search to an array?
- Explain why binary search cannot generally be applied directly to an unsorted array. Also state the worst-case time complexity of linear se…
- Which statement correctly describes the worst-case time complexity of insertion sort and the situation in which it performs efficiently?
- Explain why merge sort is generally preferred over selection sort for sorting a large collection of data. State the time complexity of both…
Practise more Computer Science
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed