1 votes 1 votes Consider the modified merge sort where we divide array into 5 equal sub arrays instead if 2(as in standard merge sort).What is the time complexity if modified merge sort? Is there any improvement over standard merge sort? Algorithms algorithms merge-sort sorting time-complexity + – rahul sharma 5 asked Mar 9, 2018 rahul sharma 5 1.3k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply G Shaheena commented Mar 25, 2018 reply Follow Share O(nlogn) 0 votes 0 votes shashank16 commented Apr 4, 2018 reply Follow Share The array is divided into 5 parts and all parts are equal so the recurrence relation will be 5T(n/5) + n On solving this will be O(nlogn). 0 votes 0 votes pradeepchaudhary commented Jul 8, 2018 reply Follow Share Dividing n into 5 parts of n/5 each is no doubt going to reduce the height of the tree and from this we might think that since height of the tree is reduced , so it's complexity is also going to reduce. But..... As of now We don't have a merge procedure which can merge 5 subparts into one part in linear time. That's where the idea is Lacking its Strength. 1 votes 1 votes Please log in or register to add a comment.
0 votes 0 votes if we want to divide the array in 5 sub array then recurrence relation become T(n) =5T(n/5)+n. it will also take o(nlogn) which is asymptotically equal. abhishekmehta4u answered Mar 9, 2018 abhishekmehta4u comment Share Follow See all 3 Comments See all 3 3 Comments reply rahul sharma 5 commented Mar 9, 2018 reply Follow Share Then why do we divide in 2? I think dividing in size of 5 will have more time complexity by some constant factor.I am looking what that constant factor is? One more thing:- You have taken time to merge as 'n',so is it possible to merge 5 sub arrays of size (n/5) in n? 0 votes 0 votes srestha commented Apr 4, 2018 reply Follow Share If we divide array more and more, will merge sort be better? Is it improve efficiency? I donot think so. If there are n elements and divide the merge sort with n element, then will mersort work at all? I donot think so. So, no of division is more, merge sort will be less efficient I think 1 votes 1 votes Jason commented Apr 4, 2018 reply Follow Share If we increase the number of division of array then I think there is no change in the time Complexity because at any point of time we can apply merge procedure over only two subarrays. which take O(n) time thus in our standard merge sort algorithm we have $n$ which denotes the time required to perform merge procedure. 0 votes 0 votes Please log in or register to add a comment.