retagged by
4,292 views
2 votes
2 votes

Let A,B,C,D,E are sorted sequences having length 70,74,80,85,102 respectively.They are merged into a single sequence by merging together two sequences at a time.The minimum number of comparisons that will be needed by algorithm in best case for going merging is _________.

retagged by

2 Answers

2 votes
2 votes

for minimum:-

(70, 102)-:70

(172, 74)-:74

(246, 80)-:80

(246, 85)-:85

             ans=309

1 votes
1 votes
Given set {70,74,80,85,102}

Merge (70,74) = 70 comparisons

Merge (80,144) = 80 comparisons

Merge (85,224) = 85 comparisons

Merge (102,309) = 102 comparisons

 

Total no. of comparisons=70+80+85+102 = 337

I hope this helps!!
Answer:

Related questions

0 votes
0 votes
1 answer
1
Santhosh Devulapally asked Jan 3, 2016
6,704 views
IF ONE USES STRAIGHT MERGE SORT TO THE FOLLOWING ELEMENTS 20,47,15,8,9,4,40,30,12,17 THEN THE ORDER OF THE ELEMENTS AFTER 2ND PASS OF THE ALGORITHM
2 votes
2 votes
1 answer
2
sh!va asked Nov 10, 2016
6,702 views
Assume 5 buffer pages are available to sort a file of 105 pages. The cost of sorting using m-way merge sort isA. 206B. 618C. 840D. 926
0 votes
0 votes
0 answers
3
Ujjal Das asked Mar 17
137 views
Calculate the minimum and maximum number of element comparisons involved in 2 way merge sort assuming n is power of 2.