3 ms·
Even if your linked list is backed by an array and all the elements are right next to each other, computing some cheap function of the elements of a linked list
by anonymoushn 4y ago
Even if your linked list is backed by an array and all the elements are right next to each other, computing some cheap function of the elements of a linked list is incredibly slow compared to the alternative because of the unnecessary and very long dependency chain.
Vectors are basically perfect for queues.