Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) Trace insertion sort on the list 5, 8, 2, 4, 9, 3 i.e. show what the list looks like after each iteration of the

(a) Trace insertion sort on the list 5, 8, 2, 4, 9, 3 i.e. show what the list looks like after each iteration of the outer loop. Also, calculate the exact number of total data comparisons made. Note that a data comparison is when two different pieces of data are compared, and not when loop variables etc are compared.

(b) Trace the merge algorithm (not the complete merge sort) on the two lists 2, 3, 7, 14 and 1, 5, 8, 9 Show what the combined list (i.e. the merged list) looks like after every step and also calculate the exact number of total data comparisons made.

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_2

Step: 3

blur-text-image_3

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

What is conservative approach ?

Answered: 1 week ago

Question

What are the basic financial decisions ?

Answered: 1 week ago

Question

4. How has e-commerce affected business-to-business transactions?

Answered: 1 week ago