Assume that data you need to access/update is always specified by \"offset addre
ID: 3721029 • Letter: A
Question
Assume that data you need to access/update is always specified by "offset address" in a file, which indicates how many bytes the target data is away from the beginning of the file. Which file organization (contiguous, linked-list or index) would vou choose to maximize efficiency in terms of speed of the data access (select the best file organization for each of the five cases below), when: (a) Data is rarely updated (almost no update) but frequently read in random order (the locations of the target data are random). (b) Data is added always at the beginning of files. (c) Data is rarely updated (almost no update) but frequently read in the sequential order from the beginning to the end of files (d) Data at random locations in a file is frequently updated. (e) Data is deleted always at the end of files. Note 1: No explanation is necessary for your solutions. Note 2: The term, "update", means modifying the content of data (but no deletion or addition of new data) The term, "access", means reading the data. Note 3: Do not assume that there is always some empty disk blocks before the first data block and after the last data block in a fileExplanation / Answer
As per your requirement i have written answers for every option please follow it step by step clearly.
a)
Actually for option a the answer will be like below
Actually when data is rarely updated and at same time in random index order, then array data structure is very good since so at any time user can switch to desired index as well as update it efficiently.
eg: a[5] = newValElement;
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
b)
Actually for option b i have given clear explaination please follow below
Actually Stack data structure is very good and nice option when always want to add at beginning of files. Actually stack follows last in first out structure that means LIFO . It always add on top and also remove top element first.
------------------------------------------------------------------------------------------------------------------------------------------------------------
c)
Actually for option c solution with explaination given below
Actually When data is rarely updated and iterating sequentially, then array data structure is very good choice. Since any time user can switch to desired index and update it. Actually Iterating starts from index 0 to array.length-1
------------------------------------------------------------------------------------------------------------------------------------------------------
d)
For option d the correct explaination given below
Whenever Data at random location updated means then array will be a best choice any time due to user can switch to desired index and update it.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
e)
For option e explaination given below follow it
Actually When data is deleting always at end means..Then queue is will be best choice since it always pop data from end.