- Back to Home »
- CS301 Assignment no 5 Spring 2013 Full Solution
Posted by : Ali Khan
Sunday, 7 July 2013
In case Operating system needs to execute the processes coming to it according to the priority assigned to it. This queue is called priority queue. It is observed that no two processes can have same priority. So priority queue is implemented in such a way that prevents addition of duplicate values. Heap is a data structure commonly used to implement priority queues but it allows duplicate values.
Write a C++ program to build a heap using array which does not support duplicate values. You are not required to use queue in heap building.
The required program functionalities should be:
· Build the min heap with no repeating values.
· Display the final heap.
Solution Guidelines:
1. First understand the code given in handouts about Min Heap.
2. The values initially should be placed in an array before moving it into heap array (You can get input from user).
3. To get the idea about exact output of program, see demo.wmv file attached with assignment file.