Skip to content

Algorithms

What is the name for a simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order?

Difficulty: Easy

About this MCQ

This Easy Algorithms MCQ checks one syllabus fact.

The question is: “What is the name for a simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order?”

The accepted answer is C. Bubble sort. Bubble sort is the fact required by “What is the name for a simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order” (option C). Option A (“Backtracking”) does not match the stem; it is a near-miss used to catch incomplete recall of Bubble sort. Option B (“Time complexity”) does not match the stem; it is a near-miss used to catch incomplete recall of Bubble sort. Remaining alternatives (Greedy algorithm) fall outside the same rule and should be eliminated once Bubble sort is identified. Algorithms questions of this type reward precise definitions rather than approximate associations. Algorithms recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.

Correct answer

C. Bubble sort

Explanation

Bubble sort is the fact required by “What is the name for a simple sorting algorithm that repeatedly swaps adjacent elements if they are in the wrong order” (option C). Option A (“Backtracking”) does not match the stem; it is a near-miss used to catch incomplete recall of Bubble sort. Option B (“Time complexity”) does not match the stem; it is a near-miss used to catch incomplete recall of Bubble sort. Remaining alternatives (Greedy algorithm) fall outside the same rule and should be eliminated once Bubble sort is identified. Algorithms questions of this type reward precise definitions rather than approximate associations. Algorithms recall of this distinction is a regular item in FPSC, PPSC, NTS, and CSS papers.

Source: Algorithms Official Reference Guide

Tags: computer science, algorithms, problem solving, complexity analysis

Submitted by: MCQsHub Editorial

Related MCQs

More Algorithms MCQs