how to find out older version of the queue
I came across this question and thought of asking what is the best
possible way to achieve this.
Given a queue. Every time an insertion or deletion happens, a new version
of the queue is created. At any time, you have to print any older version
of the queue with minimal time and space complexity.
No comments:
Post a Comment