Question: 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
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: DBACFE
Write a program to trace and display the steps of Heap sort processes
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
PLS DON"T USE CHATGPT AND WRITE IN C FOLLOW ALL INSTRUCTIONS SO THE PROGRAM WILL DISPLAY EVERYTHING CORRECTLY! THANKS!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
