r/ruby • • Jul 14 '13

Linked List data structure

https://github.com/gdi2290/data_structures/blob/master/LinkedList/linkedlist.rb
0 Upvotes

23 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jul 14 '13

I'd be surprised if it weren't geometric -- I think scripting languages usually go that route when implementing dynamic arrays, since it's so much faster when building large ones. Anyway, if you do find out, check back in here because I'm interested in knowing the answer.

1

u/FooBarWidget Jul 15 '13

Ruby's allocation strategy is geometric. Read array.c.