Question: assignment int main should give this output For this lab assignment, you should provide an implementation of Priority Queue ADT using Binary Heaps. Your program

For this lab assignment, you should provide an implementation of Priority Queue ADT using Binary Heaps. Your program should: 1. Accept a list of numbers as input 2. Build a binary heap of the given elements 3. Ask the user for the order of ascending or descending 4. Output the proper ordering for the given list (Heap Sort) 5. Print the min and max values from the list (per user's request) 6. Extract min or max value 7. Modify values in the heap 8. Add elements to the heap Enter 0 for ascending and 1 for descending order 0 Input array : 4326 //build_maxHeap() Input element: 9 //insert_val_maxHeap() sorted heap: 23469 On calling extract_maximum: 9 Sorted heap is 2346 Enter 0 for ascending and 1 for descending order 1 Input array : 4326 //build_minHeap() Input element: 9 //insert_val_MinHeap() sorted heap: 96432 On calling extract_minimum: 2 Sorted heap is 9643
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
