UGC NET JRF November 2020 Paper-2
April 15, 2025Operating-Systems
April 16, 2025Algorithms
|
Question 49
|
The minimum number of record movements required to merge five files A (with 10 records), B (with 20 records), C (with 15 records), D (with 5 records) and E (with 25 records) is:
|
165
|
|
|
90
|
|
|
75
|
|
|
65
|
Question 49 Explanation:
Always merge two files with minimum no. of records.
10, 20, 15, 5, 25
Merge 5 & 10:
5+10 = 15 movements
Now the list is
15, 20, 15, 25
Merge 15 & 15:
15+15 = 30 movements
Now the list is
30, 20, 25
Merge 20 & 25:
20+25 = 45 movements
Now the list is
30, 45
Merge 30 & 45:
30+45 = 75 movements
∴ Total no. of movements
= 15+30+45+75
= 165
10, 20, 15, 5, 25
Merge 5 & 10:
5+10 = 15 movements
Now the list is
15, 20, 15, 25
Merge 15 & 15:
15+15 = 30 movements
Now the list is
30, 20, 25
Merge 20 & 25:
20+25 = 45 movements
Now the list is
30, 45
Merge 30 & 45:
30+45 = 75 movements
∴ Total no. of movements
= 15+30+45+75
= 165
Correct Answer: A
Question 49 Explanation:
Always merge two files with minimum no. of records.
10, 20, 15, 5, 25
Merge 5 & 10:
5+10 = 15 movements
Now the list is
15, 20, 15, 25
Merge 15 & 15:
15+15 = 30 movements
Now the list is
30, 20, 25
Merge 20 & 25:
20+25 = 45 movements
Now the list is
30, 45
Merge 30 & 45:
30+45 = 75 movements
∴ Total no. of movements
= 15+30+45+75
= 165
10, 20, 15, 5, 25
Merge 5 & 10:
5+10 = 15 movements
Now the list is
15, 20, 15, 25
Merge 15 & 15:
15+15 = 30 movements
Now the list is
30, 20, 25
Merge 20 & 25:
20+25 = 45 movements
Now the list is
30, 45
Merge 30 & 45:
30+45 = 75 movements
∴ Total no. of movements
= 15+30+45+75
= 165
