The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
89 views

The average no. of comparisons performed by the merge sort algorithm, in merging 2 sorted lists of length 2 is___________.

Ans: $\frac{8}{3}$

in Algorithms by Active (5.1k points)
edited by | 89 views
+1
2.67 ?
0
How ??
+2

I'm thinking in this way.

but is it necessary to add 4th case?

+1
Nice.

No need to add the 4th case.
0

@

@ how case 2 and case 3 are different?

0
Is there any generic way for same?having n list of n elements

1 Answer

0 votes

I think answer will be 
like(total number of comarison/2)

(2+2-1)/2=1.5

by (27 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,309 questions
55,743 answers
192,227 comments
90,497 users