🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: STL Containers: all 9 questions

Quiz: STL Containers · Question 6 of 9

Which container should you use for "undo" in a text editor, where the last action is undone first?

Which container should you use for "undo" in a text editor, where the last action is undone first?

  1. A.queue
  2. B.stack
  3. C.set
  4. D.priority_queue
Answer & explanation

Correct answer: stack

Last in, first out is exactly how a stack works.

Can you get the rest right without peeking?

Take the timed Quiz: STL Containers quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →