ISRO Computer Science (CSE) 2015 - Question 13

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 2015

Six files F1, F2, F3, F4, F5 and F6 have 100, 200, 50, 80, 120, 150 records respectively. In what order should they be stored so as to optimize act. Assume each file is accessed with the same frequency

  • A. F3, F4, F1, F5, F6, F2
  • B. F2, F6, F5, F1, F4, F3
  • C. F1, F2, F3, F4, F5, F6
  • D. Ordering is immaterial as all files are accessed with the same frequency.

Answer: B. F2, F6, F5, F1, F4, F3

Explanation: Assuming 'optimize act' means optimizing storage access time on a sequential tape or similar medium, and files are accessed with the same frequency (probability), the standard Optimal Merge Pattern (Huffman) or simply sorting by size might be considered depending on the exact goal (e.g. merge time vs access). However, usually for retrieval probability P_i, order is by P_i/L_i. Since P_i is constant, order by 1/L_i (smallest length first). But standard ISRO key suggests F2(200), F6(150), F5(120)... i.e. Largest first. This minimizes expected search time if we assume the files are records within a single tape and we are searching for a specific record? Actually, if accessed with same frequency, order is immaterial for average time if searching *for* a file. But if optimizing merge? The provided answer (b) is Descending Order.

| | All questions of ISRO Computer Science (CSE) 2015