Question: In C + + , Objectives: Tracing the heap sort with Heap using Array Heap sort is the process of two steps: Transform or creating

In C++, Objectives: Tracing the heap sort with Heap using Array
Heap sort is the process of two steps:
Transform or creating or rebuilding the given array into a max heap.
Deleting the max heap and sorting array elements at the same time.
You are given a string array in this order: {"D","B","A","C","F","E")
Write a program to trace and display the steps of Heap sort processes that demonstrates in the supplemental lecture of Chapter 9.
To receive the full credit, your submission should have at least three files: heap.h, heap.cpp and heapMain.cpp.
Notes on the sample output:
The highlight text is to make it easy to see the process. You don't need to do the highlight in the actual program.
The tracing text can be placed on the left of the array as long as the display is good spacing and good alignment
Sample Output:
Processes of Heap Sort on a given string array
D B A C F E Original array
F D E C B A Initial rebuild to form a heap
A D E C B F After swapping A and F
E D A C B F rebuild min heap
B D A C E F After swapping B and E
D C A B E F rebuild min heap
B C A D E F After swapping B and D
C B A D E F rebuild min heap
A B C D E F After swapping A and C
B A C D E F rebuild min heap
A B C D E F After swapping A and B
A B C D E F Sorted array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!