Which of the following is NOT a key characteristic of a greedy algorithm ?

2024

Which of the following is NOT a key characteristic of a greedy algorithm ?

  1. A.

    Makes locally optimal choices at each step

  2. B.

    Does not guarantee globally optimal solution

  3. C.

    Might require backtracking to revise choices

  4. D.

    Suitable for solving problems with optimal substructure

Attempted by 81 students.

Show answer & explanation

Correct answer: C

A greedy algorithm is defined by its strategy of making the locally optimal choice at each step with the hope that these local choices will lead to a globally optimal solution. A defining characteristic of this approach is that once a decision is made, it is never reconsidered or revised. This means greedy algorithms do not employ backtracking to undo previous choices, which distinguishes them from other techniques like dynamic programming or exhaustive search. Therefore, the statement that a greedy algorithm 'might require backtracking to revise choices' is incorrect and represents the exception among the options. While it is true that greedy algorithms do not always guarantee a globally optimal solution (Option B) and are suitable for problems with optimal substructure (Option D), the fundamental rule is to commit to a choice immediately without looking back. Option A correctly describes their core mechanism of selecting the best immediate option.

Explore the full course: Tpsc Assistant Technical Officer