Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Performance analysis of Quick sort The aim of this assignment is measuring the time spent for sorting arrays and relating it to the input data

image text in transcribed

Performance analysis of Quick sort The aim of this assignment is measuring the time spent for sorting arrays and relating it to the input data size. Part 1: This part should be repeated with N-1000, 5000, 10000 Write a program to sort integer arrays using Quick sort. Follow the steps below: A- Create an array of size N and fill it out with random integer numbers. B- Sort the array and count the number of comparisons C- Repeat the experiment for 10 times and find the average number of comparisons. Now repeat part 1 with a sorted aray (N 1000, 5000, 10000) Repeat pa1 han array which is sorted in reverse order Part 2: In this part we combine Insertion sort with Quick sort (we will call it Hybrid sort). Modify Quick sort so that if the array size is less than 10, insertion sort is called, otherwise Quick sort is called recursively Repeat steps of part 1 and fill out the following table. Sort Algorithm used Quick Sort Data Size 1000 5000 10000 1000 5000 10000 1000 5000 10000 1000 5000 10000 1000 5000 10000 1000 5000 10000 Data Order Number of Comparisons Quick Sort Randomm Sorted Sorted Sorted Reverse Sorted Reverse Sorted Reverse Sorted Quick Sort Sort Hybrid Sort Hybrid Sort Hybrid Sort Hybrid Sort Hybrid Sort Hybrid Sort Hybrid Sort Hybrid Sort Randomm Sorted Sorted Sorted Reverse Sorted Reverse Sorted Reverse Sorted

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions