In selection sort, what is the main operation performed in each iteration?
- Doubling the size of the sorted portion
- Finding the minimum element in the unsorted portion and swapping it with the first element of the unsorted part
- Multiplying elements in the unsorted portion
- Randomly rearranging elements in the unsorted portion
The main operation in each iteration of selection sort is finding the minimum element in the unsorted portion and swapping it with the first element of the unsorted part. This gradually builds the sorted portion.
Loading...
Related Quiz
- Explain the rotation operations used in AVL trees and their significance in maintaining balance.
- What is the main goal of the Matrix Chain Multiplication algorithm?
- What is the time complexity of Dijkstra's algorithm when implemented with a binary heap?
- The time complexity of the standard dynamic programming approach for Matrix Chain Multiplication is _______.
- What are the advantages of using Insertion Sort over other sorting algorithms?