3 ms·
Mosty dequeues are implemented under the hood with arrays. A linked list usually requires a heap allocation for each element. This is speaking in generalities
by zwkrt 4y ago
Mosty dequeues are implemented under the hood with arrays. A linked list usually requires a heap allocation for each element.
This is speaking in generalities though, since you could have an “alternatively implemented dequeue or a linked list entirely on the stack.