Question

2. The mergesort is a recursive sort. What is the base case for the merge sort?...

2. The mergesort is a recursive sort. What is the base case for the merge sort?

A.There is none.

B. When right = left -1

C. When start = end

D. When end - start = 1

3. Given the array [ 23, 83, 82, 92, 28, 21, 91, 17, 54, 32, 41, 14], what is the value of mid for the call mergesort (elements, 0, 5, temp) ?

A. The value of mid is 3

B. The value of mid is 28

C. The value of mid is 2.

D. The value of mid is 82.

4. Given the call: mergesort (elements, 5, 9, temp) where the array elements contains the following values [38, 43, 34, 52, 88, 79, 87, 70, 95, 82}]. What are the values for start and end for the first recursive call in this mergesort?

A. start = 5 and end = 8

B. start = 5 and end = 7

C. start = 6 and end = 9

D. start = 8 and end = 9

5. What is the time needed for a merge sort in terms of Big-O in the best case? In the worst case?

A. Best case: O(n log n)
Worst case: O(n log n)

B. Best case: O( n2)
Worst case: O( n2)

C. Best case: O( log n)
Worst case: O(n log n)

D. Best case: O(n log n)
Worst case: O( n2)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

2) start=end

3) The value of mid is 2

4)start=5 ,end=7

5) Best case : O(n logn) , Worst case: O(n logn)

Add a comment
Know the answer?
Add Answer to:
2. The mergesort is a recursive sort. What is the base case for the merge sort?...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT