Thanks for your answer. I should have looked in the raa by myself. Just a
question regarding array as deque. How efficient is it? Is all the data
shifted through the array every time I push something at the front and
remove it from the back, or is it organized more efficiently?

Thanks,

Brian

On Thu, 20 May 2004 19:37:19 +0900, Simon Strandgaard wrote:

 
> deque, queue, list.. then ruby's builtin Array class will fit.
> 
> 
> server> irb
> irb(main):001:0> stack = []
> => []
> irb(main):002:0> stack.push(3)
> => [3]
> irb(main):003:0> stack.push(9)
> => [3, 9]
> irb(main):004:0> stack.push(10)
> => [3, 9, 10]
> irb(main):005:0> stack.pop     
> => 10
> irb(main):006:0> stack.pop
> => 9
> irb(main):007:0> stack
> => [3]
> irb(main):008:0>
> 
> 
> 
> which kind of btree do you want?  b+ b* ...  or 
> 
> red-black tree
> http://raa.ruby-lang.org/project/ruby-rbtree/
> 
> avl tree
> http://raa.ruby-lang.org/project/ruby-avl/
> 
> 
> Many goodies in the library section of RAA, which may interest you
> http://raa.ruby-lang.org/cat.rhtml?category_major=Library

-- 
Brian Schröäer
http://www.brian-schroeder.de/