2 ms·
In most of the cases where I’m using a list or array, I’m adding items to one end and then iterating forward over the structure a handful of times. But, yeah,
by fiddlerwoaroof 7y ago
In most of the cases where I’m using a list or array, I’m adding items to one end and then iterating forward over the structure a handful of times.
But, yeah, if you’re relying heavily on random access, pick a vector/array or some kind of tree/hash table.