2 ms·
With indices what you say can be implemented trivially, much simpler than with pointers, by always incrementing a reallocated index (i.e. an index extracted fro
by adrian_b 1y ago
With indices what you say can be implemented trivially, much simpler than with pointers, by always incrementing a reallocated index (i.e. an index extracted from the free list) with the array size and always addressing the array with the indices modulo the array size.
With the array size chosen to be a power of two, this adds negligible overhead in time and no overhead in space.