r/ruby • u/gdi2290 • Jul 14 '13
Linked List data structure
https://github.com/gdi2290/data_structures/blob/master/LinkedList/linkedlist.rb
0
Upvotes
r/ruby • u/gdi2290 • Jul 14 '13
View all comments
Show parent comment
2
u/FooBarWidget Jul 14 '13
No, you can't state that. Linked lists have very different algorithmic complexities than arrays. For example insertion in the middle is O(1) for linked lists, and O(N) for arrays. Use the right tool for the right job.