# Basic data structures question

**URL:** <https://www.ruby-forum.com/t/basic-data-structures-question/140001>\
**Category:** Ruby\
**Created:** [June 10, 2008, 12:29am UTC](https://www.ruby-forum.com/t/basic-data-structures-question/140001 "2008-06-10T00:29:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [June 10, 2008, 12:29am UTC](https://www.ruby-forum.com/t/basic-data-structures-question/140001/1 "2008-06-10T00:29:45Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [June 10, 2008, 2:10am UTC](https://www.ruby-forum.com/t/basic-data-structures-question/140001/2 "2008-06-10T02:10:54Z")

</div>

On Jun 9, 3:29 pm, Justin To [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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-forum.com/.

It looks like someone has covered this pretty well here:

[http://www.brpreiss.com/books/opus8/](http://www.brpreiss.com/books/opus8/)

---

<div class="post-metadata">

**Author:** ![jturney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e99b99/32.png) [@jturney](https://www.ruby-forum.com/u/jturney)\
**Post date:** [June 10, 2008, 5:14am UTC](https://www.ruby-forum.com/t/basic-data-structures-question/140001/3 "2008-06-10T05:14:30Z")

</div>

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.”
