Q35
MSQ2 marksData structuresConsider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and that all keys are distinct. We wish to augment the stack data structure with an time MIN operation that returns a pointer to the record with smallest key present in the stack (i) without deleting the corresponding record, and (ii) without increasing the complexities of the standard stack operations. Which one or more of the following approach(es) can achieve it?
Sign in to save attempts.
Keys: A–D or 1–4 choose, Enter checks, ← → move between questions.
The solution is hidden while you attempt this question. It opens once you check or show the answer.