Also, vectors are not contiguously memory slotted "always". Its a expanding array where the resizing takes place on demand. There are times when the array backing the vector is resized and re-allocated, but even then the amortized cost of insertion stays linear (O(n)). Although it makes sense to think that since all the microprocessor requires to do is an index*datasize calculation in case of an array or a vector, it would be interesting to note what happens to the execution runtime of two-way sequential access when there are frequent insertion-deletion-sequential-access cycles. My guess is that since there would be frequent insertions, that would trigger a vector doubling frequently (which translates to resizing and reallocation, an expensive operation). I guess if the application does frequent random insertions and random deletions and then looks for sequential accesses, DLL can beat vector.
On Fri, Nov 23, 2012 at 9:00 AM, Atul Singh <atulsingh7...@gmail.com> wrote: > @Pralay.. can u give a more detail about "non synced data structure" > > -- > > > --