retagged by
867 views
2 votes
2 votes

Suppose we do merge sort with a three-way split: divide the array into 3 equal parts, sort each part and do a 3 way merge.

What would the worst-case complexity of this version be?

 

  1. O($n^2$)
  2. O($n^2$ log3n)
  3. O(n log2n)
  4. O(n $(log2n)^2$)  
retagged by

1 Answer

Best answer
0 votes
0 votes

C. O(n log2n) ...

 

# A variant of merge sort is called 3-way merge sort where instead of splitting the array into 2 parts we split it into 3 parts…

 

  ##  Merge sort recursively breaks down the arrays to subarrays of size half...

 

###  Similarly, 3-way Merge sort breaks down the arrays to subarrays of size one third...

 

1. https://en.wikipedia.org/wiki/Merge_sort

 

selected by

Related questions

0 votes
0 votes
3 answers
2
0 votes
0 votes
1 answer
4