title: Are there any interesting algorithms using both a stack and queue (deque) ADT?
body: <p>We often use stacks or queues in our algorithms, but are there any cases where we use a doubly linked list to implement <strong>both</strong> a stack and a queue in the algorithm? For example, at one stage, we push() 6 items onto the stack, pop() 2 items, and then dequeue() the rest of the items (4) from the tail of the doubly linked list. What I am looking for are obscure, interesting algorithms that implement something in this method, or even stranger. Pseudocode, links and explanations would be nice.</p>