• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between random access data and sequential acces.

 
Prashant Neginahal
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
Arvind Varma
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic