Question: WRITE THIS IN C PROGRAMMING LANGUAGE. Priority queue with max - heap - tree property in each row of an NxM matrix is desired to

WRITE THIS IN C PROGRAMMING LANGUAGE. Priority queue with max-heap-tree property in each row of an NxM matrix is desired to be created. On the other hand, the capacity of each queue is different. The number of columns of the matrix is priority queues should be determined according to the one with the highest capacity. Priority at each step From the first elements of the queues, the one with the highest priority is removed from the relevant queue. These steps are continues until there are no more elements in the queues. The algorithm that you will design will be should print the queues on the screen.
The steps to be applied in your programme are as follows:
1. Read the matrix dimensions (N and M) from outside.
2. The N-dimensional array storing the capacity of each priority queue must be read from outside.
3. The numbers you will generate between 0-K (K>NxM) should be randomly placed in the matrix considering the sizes of the queues.
- Note There must be 1 of each number in the matrix. In other words, the matrix should consist of "unique" numbers.
4. After random number placement in the matrix, the matrix should be printed on the screen. Then each priority queue should be arranged to have max-heap-tree property and the new version of the matrix should be printed on the screen.
5. After all the queues have been organised, it is expected to obtain the maximum elements from the queues and remove the highest one from the relevant queue.
6. After the element is removed, the relevant queue is rebuilt in such a way that the max-heap-tree edit the matrix.
7. The new state of the matrix at the end of that step should be printed on the screen.
8. The number of the priority queue with no more elements should be stored in another array.
9. When all queues are empty, the array storing the queue information should be printed on the screen.
Note: No other data structure other than matrix should be used to store priority queue information.
Write this in C programming language.

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