How do I prove by using induction on k, that MergeSort uses n ( log 2 </msub

pachaquis3s

pachaquis3s

Answered question

2022-06-13

How do I prove by using induction on k, that MergeSort uses n ( log 2 ( n ) + 1 ) = 2 k ( k + 1 ) comparisons?

Answer & Explanation

Sawyer Day

Sawyer Day

Beginner2022-06-14Added 30 answers

Step 1
You are doing nothing wrong (except maybe when you checked the basis step). The correct formula for the number of comparisons for a list of length 2 k should be ( k 1 ) 2 k + 1.
Step 2
You can see that the formula provided is not correct, as it says we would have 2 comparisons for a list on length 1, or 4 comparisons for a list of length 2, and in both cases that does not make any sense.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?