Re: [algogeeks] fastest sequential access

2012-11-23 Thread Pralay Biswas
i) vector = A non synced data structure good for random access and bad for insertions,deletions and sequential scans. ii) Singly linked list = Bad for random access, good for one way sequential access, good for insertions in the middle. iii) Doubly linked list = Bad for random access, best for

Re: [algogeeks] fastest sequential access

2012-11-23 Thread Pralay Biswas
I am sorry, vectors are synced and hence slow (concurrency overhead, arraylists are non synced). Rest remain the same, if your application demands frequent two way sequential scans, go for DLL. Pralay Biswas MS-CS, University of California Irvine On Wed, Nov 21, 2012 at 6:57 AM, Pralay Biswas

Re: [algogeeks] fastest sequential access

2012-11-23 Thread Atul Singh
i would rather suggest vector for FAST SEQUENTIAL ACCESS as Vector contain elements in contiguous memory locations...so cache locality is good in case of it as in case of Singly Linked List or Doubly Linked List,, cached locality is not good,, Sequntial access would not be fast in a long run..

Re: [algogeeks] fastest sequential access

2012-11-23 Thread Atul Singh
@Pralay.. can u give a more detail about non synced data structure --

Re: [algogeeks] fastest sequential access

2012-11-23 Thread Pralay Biswas
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

Re: [algogeeks] fastest sequential access

2012-11-23 Thread shady
assume there are no additional insertions, so we care about only accessing an element. On Sat, Nov 24, 2012 at 12:30 AM, Pralay Biswas pralaybiswas2...@gmail.comwrote: non synced data structure = not thread safe in most prog languages! On Fri, Nov 23, 2012 at 9:00 AM, Atul Singh

Re: [algogeeks] fastest sequential access

2012-11-22 Thread Praveen Kumar
The answer should be a vector because it uses an array to store the elements internally and since an array consists of contiguous memory locations, sequential access will be the fastest. In contrast to SLL or a DLL, the nodes may be at random memory locations and will not provide the fastest

[algogeeks] fastest sequential access

2012-11-21 Thread shady
which data structure among the follow has fastest sequential access ? i) vector ii) Singly linked list iii) Doubly linked list it won't be doubly linked list as it involves more pointer manipulations than singly linked list... --

Re: [algogeeks] fastest sequential access

2012-11-21 Thread vishal chaudhary
singly linked list On Wed, Nov 21, 2012 at 8:21 PM, shady sinv...@gmail.com wrote: which data structure among the follow has fastest sequential access ? i) vector ii) Singly linked list iii) Doubly linked list it won't be doubly linked list as it involves more pointer manipulations

Re: [algogeeks] fastest sequential access

2012-11-21 Thread atul anand
@shady : as subject says fastest sequential access , then if i am not getting it wrong.we only care of sequential access a value not modifying the linked list. so i guess double linked list would be helpful 1) bcozz it can move in both the direction , so if linked list is sorted then it would be