Greedy-approach
October 26, 2023Greedy-approach
October 26, 2023Greedy-approach
Question 16
|
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
F3, F4, F1, F5, F6, F2
|
|
F2, F6, F5, F1, F4, F3
|
|
F1, F2, F3, F4, F5, F6
|
|
Ordering is immaterial as all files are accessed with the same frequency.
|
Question 16 Explanation:
Optimal merge pattern will give the optimal result after performing sorted order. Every time it will take least frequency elements and performing merging.
→ Final order is F3, F4, F1, F5, F6, F2
→ Final order is F3, F4, F1, F5, F6, F2
Correct Answer: A
Question 16 Explanation:
Optimal merge pattern will give the optimal result after performing sorted order. Every time it will take least frequency elements and performing merging.
→ Final order is F3, F4, F1, F5, F6, F2
→ Final order is F3, F4, F1, F5, F6, F2
Subscribe
Login
0 Comments