Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Lab 3, you have worked on Quick Sort Algorithm. Modify the Partition algorithm by using the first element as pivot, and complete the program.

image text in transcribed
image text in transcribed
1. Lab 3, you have worked on Quick Sort Algorithm. Modify the Partition algorithm by using the first element as pivot, and complete the program. Also, modify your main function to use random data in the range from 1 to 100 rather than data values are being read using input statement. Must submit the code along with results, and must use at least 50 data to do sorting. Results should be displayed as 10 data per line. 2. Illustrate Quick Sort algorithm to sort the following data. Also compute runtime at each step until done, and add the total. Data Given: 36, 41, 9, 30, 45, 8, 18, 22, 20 Must use the following table. 123456789 Runtime Explanation of Algorithm 3. Given the following data sets each set containing 8 data as given below: a) 32, 24, 20, 18, 16, 15, 10,5 b) 5, 19, 15, 16, 18, 20, 24, 32 c) 32, 24, 20, 16, 15, 10, 5, 18 If you implement quick sort in each case, what would be the runtime in each case? 4. A) Build a Max Heap using the following data: 35, 12, 7, 18, 24, 40, 39 Runtime Explanation of Algorithms B) Now show how you would delete the root from this maxheap. You must start from your answer of problem 4. Runtime Explanation of Algorithms 5. Start from the answer of problem 4 (b) and illustrate Heap Sort algorithm. Runtime Explanation of Algorithms

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

Beginning ASP.NET 2.0 And Databases

Authors: John Kauffman, Bradley Millington

1st Edition

0471781347, 978-0471781349

More Books

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago

Question

2. Identify the employees who are included in the plan.

Answered: 1 week ago

Question

7. Discuss the implications of a skill-based pay plan for training.

Answered: 1 week ago