[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Basic data structures question

Justin To

6/9/2008 10:30:00 PM

I've been reading about tries and binary trees, atrees, etc... but I'm
confused as to exactly what they are... are these data structures
"man-made" via the basic data structures like arrays? Also, how would
you make your own hash in Ruby, is this even practical given that Ruby
has its own built in hash?

Thanks a lot!
--
Posted via http://www.ruby-....

2 Answers

ElectricTeepee@gmail.com

6/9/2008 11:34:00 PM

0

On Jun 9, 3:29 pm, Justin To <te...@hotmail.com> wrote:
> I've been reading about tries and binary trees, atrees, etc... but I'm
> confused as to exactly what they are... are these data structures
> "man-made" via the basic data structures like arrays? Also, how would
> you make your own hash in Ruby, is this even practical given that Ruby
> has its own built in hash?
>
> Thanks a lot!
> --
> Posted viahttp://www.ruby-....

It looks like someone has covered this pretty well here:

http://www.brpreiss.com/bo...

Tim Hunter

6/10/2008 2:06:00 AM

0

Justin To wrote:
> I've been reading about tries and binary trees, atrees, etc... but I'm
> confused as to exactly what they are... are these data structures
> "man-made" via the basic data structures like arrays? Also, how would
> you make your own hash in Ruby, is this even practical given that Ruby
> has its own built in hash?
>
> Thanks a lot!

Yes, you could implement your own hashes in Ruby, using arrays. I'm not
going to type in the code, but back when I was coding in FORTRAN (in
which array was the only built-in data structure) we used to say that
"all data structures are just special cases of array."

--
RMagick: http://rmagick.ruby...
RMagick 2: http://rmagick.ruby...rmagick2.html