In programming, which of the following is not a fundamental control structure used to build algorithmic logic?

Difficulty: Easy

Correct Answer: Sorting

Explanation:

Introduction / Context:Structured programming identifies three basic control structures used to compose any algorithm: sequence, selection, and repetition. These govern the flow of execution. Sorting, by contrast, is an algorithmic task that can be implemented using the three control structures but is not itself a control structure.

Given Data / Assumptions:

  • We distinguish between control structures (flow of control) and algorithms (problem-specific procedures).
  • Sequence = do statements in order; selection = choose among branches; repetition = loop until a condition.
  • Sorting = goal-oriented procedure (e.g., bubble sort, quicksort) built using control structures.

Concept / Approach:Identify which options are primitives of flow control. Sequence, selection, and repetition qualify. Sorting is a computational problem whose solution uses those primitives but does not define the flow primitive itself.

Step-by-Step Solution:1) List canonical control structures: sequence, selection, repetition.2) Recognize sorting as an algorithm class, not a control primitive.3) Therefore, select “Sorting” as not a control structure.4) Confirm that “None of the above” would be incorrect because at least one option (sorting) is not a control structure.

Verification / Alternative check:Programming textbooks define structured programming with these three constructs; sorting appears as an application domain of algorithms.

Why Other Options Are Wrong:Repetition: loop constructs like for/while.Selection: if/else/switch branching.Sequence: straight-line execution.None of the above: wrong since one option is indeed not a control structure.

Common Pitfalls:Confusing algorithm families (sorting, searching) with the flow controls used to implement them; assuming domain tasks are primitives.

Final Answer:Sorting

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion