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

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

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

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 Databases Questions!