Question 92Asked in BPSC TRE 3.0 (2024) Computer Science Class 11-12

A queue has configuration a, b, c, d. If you want to get the configuration d, c, b, a, you need a minimum of _______.

  1. A2 deletions and 3 additions
  2. B3 deletions and 3 additions
  3. C4 deletions and 4 additions
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (B) 3 deletions and 3 additions

Explanation

The front element d must stay in place. Delete a, b and c (3 deletions) and add them back as c, b, a (3 additions), giving d, c, b, a.

From BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper

This is question 92 of BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.