Reputation: 53
I need a data structure that has O (1) access time like an array, but where you don't have to know the size beforehand. A linked list is out because of the access time and otherwise I only read from a dynamic array. But my professor doesn't want me to use a dynamic array. What else is there?
Thanks for any help!
Lisa
Upvotes: 0
Views: 51
Reputation: 26
You could use Hash tables - Read, Search, Insertion, and Deletion yields O(1) each.
Upvotes: 1