Skip to main contentSkip to solution

A deque contains ‘a’, ‘p’, ‘l’, ‘m’ and ‘n’ . Elements received after deletion are ‘a’, 'n', ‘m’, ‘p’ and ‘l’. ________________ is the sequence of deletion operations performed on the deque.

Solution

✅ Correct Option: 1

Deque from front to rear: a, p, l, m, n. The required deletion order is a, n, m, p, l.

Element removedDeque beforeEnd used
aa p l m nFront
np l m nRear
mp l mRear
pp lFront
llRear

The sequence is DeletionFront, DeletionRear, DeletionRear, DeletionFront, DeletionRear.


Option 2: starts with DeletionRear, which removes n first, not a.

Option 3: the fourth deletion is from the rear, which removes l, not p.

Option 4: the second deletion is from the front, which removes p, not n.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question