wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> cs >> Steque
(Message started by: Skandh on Aug 30th, 2011, 4:46am)

Title: Steque
Post by Skandh on Aug 30th, 2011, 4:46am
I was going through 'Algorithms' by Robert Sedgewick.

I found Data Type Steque defined as :

"A stack-ended queue or steque is a data type that supports push, pop, and enqueue."

I am not able to visualize this data type. Isn't enqueue() and push() are same operation with this data type or if not how are they different.

And what is "stack-ended queue"? This phrase needs some elaboration.

Thanks.

Title: Re: Steque
Post by SMQ on Aug 30th, 2011, 4:54am
Enqueue would add an item to the bottom of the stack, rather than the top.  So a steque supports adding items at either end, but removal from only one end.

--SMQ



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board