Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does memoization not improve the runtime of Merge Sort?

Why does memoization not improve the runtime of Merge Sort?

I have this question from Assignment task. But as far as I know, Merge Sort uses divide and conquer approach (no overlapping subproblems) but Memoization is based on dynamic programing (with overlapping subproblem). I know the runtime of Merge Sort is O(nlogn) .

I even searched on web search engines and there is no result for this question. Is this question wrong? If it sounds wrong but why would a professor give a wrong question in assignment? If the question is not wrong or my understanding about the question, Merge Sort and Memoization is wrong, How should I answer this question?

like image 352
robinleathal Avatar asked Dec 10 '22 09:12

robinleathal


1 Answers

You have already given the answer in the question. Memoization implies writing a memo after solving a problem, so that when we encounter the problem again, we use the memo instead of solving the same problem again.

Since in mergesort, the problems don't overlap, writing a memo is of no use.

like image 132
displayName Avatar answered Dec 13 '22 10:12

displayName