From: Robert Klemme Date: 2011-03-07T21:40:35+09:00 Subject: Re: Ruby - Missed some core computer science world ? On Sun, Mar 6, 2011 at 10:05 AM, Lucky Dev wrote: > I am just wondering, if the ruby world is sooo > immersed in its beautiness and is not doing much to embrace cleverness > in ruby world. > > I mean, the whole world of datastructures and algorithms, seems to have > much lower importance on a ruby programmer's mind. Is it so? Certainly not for me but it may be the case for the community on average. > Also, I don't see much "good" books on datastructures and algorithms in > ruby or Have I missed to notice them in the market. Can you please point > me to good datasturctures and algorithms learning book using ruby. Basically *any* good book on data structures and algorithms will do - regardless of programming language used for examples. Transferring examples from one language to another is usually easy to do. I never grokked why Sedgewick wrote his algorithms books for all sorts of programming languages. Note, I am not saying they are bad - actually I believe they are pretty good. But I think he overdid it in terms of programming languages. With regard to lack of data structures, if you need a tree it can be as easy as TreeNode = Struct.new :data, :left, :right, :parent do include Enumerable def each(&b) left and left.each(&b) b[data] right and right.each(&b) self end end But of course it depends on the use case how your tree will really look like. I don't think you'll gain much by including a generic tree in the standard library because it is so easy to implement and you need specific code for every real tree anyway. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/