1 votes 1 votes Algorithms algorithms sorting merge-sort time-complexity + – Parshu gate asked Nov 20, 2017 Parshu gate 852 views answer comment Share Follow See all 6 Comments See all 6 6 Comments reply Show 3 previous comments joshi_nitish commented Nov 20, 2017 reply Follow Share @Surajit But at rth level the size of each sublist will be r, that means insertion sort would contribute r^2 (for each sublist) * 2^r (no of sublists) and then merge back at rth level size of each list will be $\frac{n}{2^{r}}$ and we have total of 2r list, therefore total time taken to perform insertion sort on 2r lists will be 2r * ($\frac{n}{2^{r}}$)2 = O(n2) 3 votes 3 votes Surajit commented Nov 20, 2017 reply Follow Share yes correct,my mistake in calculation.But this is kind of increases complexity of the program itself,asymptotically a direct insertion sort might have produced same result maybe added few more constant terms. 0 votes 0 votes Surajit commented Nov 20, 2017 reply Follow Share If one can get a sublist of size of 2^r and no of sublist as n/2^r then I think we can perform better.(Just a thought,out of the context of the questions given). 0 votes 0 votes Please log in or register to add a comment.