Use pointers to the actual data instead of element location. By enclosing
the actual values with objects or memory blocks, and use the pointers as the
element values. Thus you can add, delete, sort the collection without
worrying about bounds errors from cached indexes since the pointers point
directly to the actual values instead of the element location. Of course,
element addition/deletion should be followed by allocating/deallocating the
memory that encloses the actual element value.
Technically, this would be an array of pointers where each points to an
allocated memory that contains the element value.