Question: Part A: Heap Matrices ( 3 0 marks ) Background The binary heap seen in class is implemented as linear array and can be used
Part A: Heap Matrices marks
Background
The binary heap seen in class is implemented as linear array and can be used to represent an instance of the class Priority Queue. An alternate way to represent a Priority Queue is an matrix where:
the items of each row are sorted in decreasing priority from left to right, and
the items of each column are sorted in decreasing priority from top to bottom.
The matrix therefore can hold at most items. If there are fewer items, then the remaining locations are set to undefined eg or null We will call this special type of matrix a Heap matrix.
Example of a Heap matrix with integers:
table
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
