aspose file tools*
The moose likes Java in General and the fly likes Difference between random access data and sequential acces. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Difference between random access data and sequential acces." Watch "Difference between random access data and sequential acces." New topic
Author

Difference between random access data and sequential acces.

Prashant Neginahal
Ranch Hand

Joined: Dec 04, 2002
Posts: 76
Hi,
what is difference between "random access" data store (such as an array) and sequential access data (such as a linked list)?
I got this doubt while reading difference between AbstractList and AbstractSequentialList, two abstract classes.
Hope somebody will help me..


--------------<br />Prashant<br />SCJP-91%
Arvind Varma
Ranch Hand

Joined: Dec 24, 2002
Posts: 48
These terms have more to do with how elements are stored.
Random Access - Is self explanatory in the sense you can access elements without worrying about how they are stored. The cost of accessing the element is always constant(independent of number of elements)
Sequntial Access - You need to traverse a list to access a particular object. Depending on how the elements are stored will affect the way you access it. The cost in this case may vary from 1(case when ur searching for first element) or 'n'(case when ur searching for last element)
Do post ur views if ur still not clear about it
Thanks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Difference between random access data and sequential acces.