Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

that the 4 3-way Merge Sort Consider the natural 3-way extension of merge sort: function mergesort3(A) if len(A) S 1: return A Al mergesort3(A[1.n/3) A2

image text in transcribed

image text in transcribed

that the 4 3-way Merge Sort Consider the natural 3-way extension of merge sort: function mergesort3(A) if len(A) S 1: return A Al mergesort3(A[1.n/3) A2 mergesort3(A[n/3+1.2/3n]) A3 mergesort3(A[2/3n+1.) return merge3(A1,A2,A3) (The merge3 function is defined similarly to the usual merge function, except now it uses three fingers.) Is mergesort3 faster than the normal merge sort? Let's find out! (It may be helpful to draw the tree asked for in part e as you answer parts a-d. (a) What is the branching factor of mergesort3's recursion tree? (b) What is the factor by which a child node's problem instance size shrinks compared to its parent's problem instance size? (c) What is the height of mergesort3's recursion tree? (Indicate the base of any logs involved.) (d) How many nodes are there on layer & of mergesort3's recursion tree (in the worst case)? (e) Approximately how many comparisons (including an estimate of the hidden big-0 coefficient if possible) are performed by the natural merge3(A1,A2,A3) subroutine, as a function of its input size (i.e., n- len(A1)+len(A2)+len(A3)) in the worst case

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

What types of questions would make up a behavioral interview?

Answered: 1 week ago

Question

1. Television more Over watching faceing of many problems ?

Answered: 1 week ago

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago

Question

1. How will you, as city manager, handle these requests?

Answered: 1 week ago

Question

1. Identify the sources for this conflict.

Answered: 1 week ago

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago