With which of the following sorting techniques, the list is divided into two parts - one of sorted elements and another of unsorted elements. Each element in the unsorted list is considered one by one and is inserted into the sorted list at its appropriate position. At each pass, the sorted list is traversed from the backward direction to find the position where the unsorted element could be inserted.
With which of the following sorting techniques, the list is divided into two parts - one of sorted elements and another of unsorted elements. Each element in the unsorted list is considered one by one and is inserted into the sorted list at its appropriate position. At each pass, the sorted list is traversed from the backward direction to find the position where the unsorted element could be inserted.
Solution
Insertion sort keeps the list in two parts, a sorted part and an unsorted part. It takes each element of the unsorted part one by one and scans the sorted part from the back, shifting larger elements right, until it finds the correct position to insert the element.
Selection Sort: also has sorted and unsorted parts, but it picks the minimum from the unsorted part and swaps it to the end of the sorted part. It does not scan the sorted part backward to insert.
Bubble Sort: repeatedly compares and swaps adjacent elements, and does not insert elements into a sorted part.
Related questions:
2026: 23 May Shift 1
2025: 16 May Shift 1
2025: 14 May Shift 1
2025: 3 June Shift 2
2025: 15 May Shift 2