Basic data structures question

J

Justin To

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!
 
E

ElectricTeepee

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!

It looks like someone has covered this pretty well here:

http://www.brpreiss.com/books/opus8/
 
T

Tim Hunter

Justin said:
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."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top