What is the difference between direct access and sequential access?

Both terms "direct access" and "sequential access" refer to accessing schemes in the file system.





  • Sequential access must begin at the beginning and access each element in order, one after the other.
  • Direct access allows the access of any element directly by locating it by its index number or address.
  • In sequential access addition of data is fast but retrieval of data is slow.
  • In direct access addition of data is slow as reordering of data blocks may be needed to put current data block after the last used data block for the file. But retrieval of data is fast.
  • Data structure implementing Sequential access is linked list.
  • Data structure implementing Direct access is an Array.
Application areas:-A situation where rate of addition of data is much larger compared to retrieval of data Sequential access is preferred, in opposite situation Direct access is more suitable.
Magnetic tape has only sequential access, but CDs had direct access.

If you are on a railroad train, to go from one car to another you must use sequential access. But when you board the train initially you have direct access.

There are technical explanations as to how it works, but in simple terms, direct access means going straight to the record you want, whereas sequential access means going through all records one by one until you find the one you want.

Comments

Popular posts from this blog

What is the purpose of jam signal in CSMA/CD?

Difference Between EEPROM and Flash