Implement Stack using Queues - Stack - The problem is opposite of this post. We are given a Queue data structure that supports standard operations
Tag - implement stack using linked list
The idea is to use Reservoir Sampling. Following are the steps. This is a simpler version of Reservoir Sampling as we need to select only one key.