Re:Show HN: Array with Constant Time Access and Fast Inserti...
by tempay on Wednesday September 04, 2019 @03:05AM
(#20874677)
You have to move the data to make space for the new value (or fill the space for deletion). Imagine you have an array of 5 numbers:
Deleting number three requires you to do three operations:
Similarly inserting a second three requires 3 operations
This means as the array gets bigger you have to do more work to insert/delete values. If your arrays are large and need to do this often, your software will be very slow and you should use a more suitable data structure with different trade offs.
[ Parent
| on HN ]
There are no comments on this comment yet.