Domanda di colloquio di Lockheed Martin

What is the difference between a vector and a linked list?

Risposta di colloquio

Anonimo

10 lug 2015

Vectors are another name for dynamic arrays. Good for random read access and for inserting and deleting from the tail of the vector. However, they are inefficient for insertion and deletion from the head to the tail-1. Linked lists are efficient for inserting and deleting from any position of the collection.