Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 (20 points) 1.1 (10 points) Show how an initially empty binary heap would look like after inserting 10, 12, 1, 14, 6, 5,

image text in transcribed

Problem 1 (20 points) 1.1 (10 points) Show how an initially empty binary heap would look like after inserting 10, 12, 1, 14, 6, 5, 8, 15, 3, 9,7,4,11, 13 and 2 one at a time 1.2 (10 points) Show the result of using the linear-time algorithm to build a binary heap using the same input Problem 2 (20 points) Sort the array 3, 1, 4, 1, 5, 9,2, 6, 5 in ascending order using insertion sort. Show how the array looks like after each iteration of the outer for loop. Problem 3 (20 points) Sort the array 9, 8, 7,6, 5, 4, 3, 2, 1 in ascending order using Shell sort with the increments 7, 3, 13. Show how the array looks like after sorting with each of the increments Problem 4 (20 points) Sort 3, 1, 4, 1, 5, 9, 2, 6 in ascending order using mergesort. Show inputs and outputs of all recursive calls Problem 5 (20 points) Sort 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5 in ascending order using quicksort with median-of-three partitioning and a cutoff of 3. Show inputs and outputs of all recursive calls Extra credit (20 points) What is the running time of shellsort using the two-increment sequence {1, 2)

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions