0 0 votes In the standard merge sort algorithm on a list of size n, what is the maximum number of times an item can be compared? Algorithms algorithms merge-sort + – Hemant Soni 1 726 views answer comment Share Follow Print See 1 comment 1 1 comment reply Hemanth_13 commented Nov 26, 2018 i edited by Hemanth_13 Nov 26, 2018 reply Follow flag Items of size 1---> n/2-1 Items of size 2---> n/2 -1 for size 4->> n/2 -1 Continue this for logn times => n/2 + n/2 +n/2 + .... logn times - logn => n/2 * logn - logn comparisons are required 0 0 replyShare Please log in or register to add a comment.
0 0 votes The element be let in any of these 2^k elements and once our element is compared within sub-array , it will not again compared with any element within sub-array again. Total comparison of an item = n/2+ n/(2^2)+. . . . + n/(2^k) where n/(2^k) =1 = n*(1-1/(2^k)) = n - n/(2^k) = n-1 Shamim Ahmed answered Nov 26, 2018 Shamim Ahmed comment Share Follow 0 reply Please log in or register to add a comment.