Philips Interview Question

C++ default methods, how is STL list, vector etc. implemented.

Interview Answer

Anonymous

Mar 30, 2016

In the C++ STL lists are implemented as doubly-linked lists (i.e. nodes need not be contiguous in memory and each node contains a reference to the node preceding and the node following it); a vector is implemented using an array, but unlike a standard array, a vector can be dynamically resized, if the underlying array is filled up, it is replaced with a larger array.

1