(1) Selection Sort: Selection sort finds the minimum element in the unsorted portion and places it at the beginning. It does not compare neighboring elements and swap them repeatedly.
(2) Bubble Sort: Bubble sort repeatedly compares adjacent elements and swaps them if they are in the wrong order. This process bubbles the largest element to the end of the array in each pass.
(3) Insertion Sort: Insertion sort iterates through the array and inserts each element into its correct position in the sorted portion. It shifts elements as needed, but its primary operation is not solely comparing and swapping neighbors.
(4) Quick Sort: Quick sort is a divide-and-conquer algorithm that selects a pivot element and partitions the array around it. While there are comparisons and potentially swaps involved in partitioning, it doesn't only compare and swap neighboring elements.
Therefore, the algorithm that compares neighboring elements and swaps them when necessary is (2) Bubble Sort.
Re-arrange the following parts of a sentence in their correct sequence to form a meaningful sentence.
(A) the decision was announced publicly
(B) after weeks of speculation and media reports
(C) by the government officials
(D) during a press conference
Choose the correct answer from the options given below: