Skip to main content
3 of 3
added 4 characters in body; edited tags; edited title
Raphael
  • 72.9k
  • 30
  • 181
  • 393

What are efficient data structures for inserting and accessing elements?

Is there a data structure to keep a list of elements (not necessarily sorted) that performs the Access (by index) and Insert operations in a reasonable asymptotic time?

When I say "reasonable time", I mean that it should be equal to or better than $O(\log N)$.

I'm looking for a structure similar to a dynamic array, but I need a better behavior in the Insertion operation. When the array size grows, the time grows exponentially (Except at the end of the array).

vicentazo
  • 215
  • 3
  • 5