retagged by
702 views

2 Answers

0 votes
0 votes

In merge sort, at each level n decrease by a factor of 2,

Meaning, at the top level there are n elements,

it is decreasing as :

n/2,n/4,n/8,n/16..... upto 1

 at levels 2,3,4,5...... upto log(n)

we stop when n=1 or a constant.

so how many steps does it take for n to decrease from n to 1 is log(n). If we are decreasing by a factor of two.

reshown by

Related questions

0 votes
0 votes
0 answers
2
Nandkishor3939 asked Jan 21, 2019
679 views
What is the extra memory needed for merge sort:1] In case of Iterative merge sort.(DS:Array)2]In case of Recursive merge sort.(DS:Array)3] In case of Iterative merge sort...
0 votes
0 votes
0 answers
3
Vikas123 asked Jan 8, 2019
994 views
Can anyone help me to understand this problem….??
0 votes
0 votes
1 answer
4
Abhisek Tiwari 4 asked Nov 24, 2018
623 views
no of comparisons in merge sort max?how many max no swaps??[if inplace algo]