Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 Suppose Mergesort is run on the array 23546081 Which of the following will actually occur at some point during the execution of the

image text in transcribed

QUESTION 1 Suppose Mergesort is run on the array 23546081 Which of the following will actually occur at some point during the execution of the algorithm? "Merge of x xxx and Y Y Y Y" means a merge operation is called on those two exact lists at some point.) Merge of 2 3 45 and 01 6 8. A comparison of the 2 and the 8 O Merge of O 1 and 6 8 Merge of 0 123 and4568 O Merge of 2 3 and 0 6. Comparison of the 2 and the S5. QUESTION 2 Which of the following best describes the state of the Mergesort algorithm just before the final merge? The recursion gets down to a single element, which is easy to sort The first N-1 elements of the array are sorted relative to each other, and only the final element is out of place. All the elements of the array are sorted except for two, which are swapped Two sorted arrays (possibly stored as two haves of a single array QUESTION 3 In Insertion Sort, which of the following best describes the state of the array just before the last element of the array is compared for the first time? (Don't pick an answer that is only true in special cases.) O The first N-1 elements of the array are sorted relative to each other, leaving only the final element potentially out of order O The array is sorted besides two out-of-order elements, which should be swapped. The array is actually sorted already, and just needs a final pass to check that this is the case. 0 The item that used to be at the end of the array is now one space away from where it should be

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions

Question

3. How disruptive is Uber?

Answered: 1 week ago