Programming Question
Question 1 (25 pts):Assume the following list of keys:
52, 7, 92, 28, 70, 49, 86, 33, 63, 25, 15
This list is to be sorted using the quick sort algorithm as discussed in this chapter. Use pivot as the
middle element of the list, and fill in the blank squares below.
Question 2 (25 pts):
Assume the following list of keys:
30, 45, 1, 26, 90, 5, 85, 35, 20, 41, 38, 72, 11, 33, 49
This list is to be sorted using the merge sort algorithm as discussed in this chapter. Fill in the blank
squares below.
Question 3 (25 pts):
Assume the following list:
30, 45, 1, 26, 90, 5, 85, 35, 20, 41, 38, 72, 11, 33, 49
(a) Using the function buildHeap as given in this chapter, convert the list into a heap.
(b) Show the resulting list after three passes of heapsort. (Use the heapify procedure as given in this
chapter.)
One pass:
Two passes:
Three passes:
Question 4 (25 pts):
Modify the quick sort implementation in the textbook to sort the array using pivot as the median of the
first, last, and middle elements of the array. Add the modified quick sort implementation to the
arrayListType class provided (arrayListType.h). Ask the user to enter a list of positive integers ending
with -999, sort the integers, and display the pivots for each iteration and the sorted array.
Submit the source code, and copy and paste the screenshot of the output here.
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics