Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This question is related to merge sort, and what I mean by trace I would like it to be in a table like this where

image text in transcribed

This question is related to merge sort, and what I mean by trace I would like it to be in a table like this

image text in transcribedwhere p= first index, q=midlle index and r = last index. and the pseudocode is like this..

image text in transcribed

Pseudo-code Trace the pseudo-code using: a. [12,17, 6,7] p q r k nl n2 i 1 j MERGE(A, p.0,r) 1 n = 9-p + 1 2 n2 = r-9 3 let L[1..n, + 1) and R[1 .. 12 + 1] be new arrays 4 for i = 1 to ni 5 L[i] = Ap + i - 1] 6 for j = 1 to 12 7 R[j] = A[g + i] 8 L[n + 1] = = 0 9 Rin2 + 1] - = 0 = 10 i = 1 11 j = 1 12 for k = p to r 13 if L[i] = R[;) 14 A[k] = L[i] 15 i = i +1 16 else A[k] = R[] 17 j = j +1

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

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago