Question: coding must be done in c# Question 4 (9 marks) a) (2 marks) Draw the binary heap that is represented by the following array A

coding must be done in c# Question 4 (9 marks) a) (2coding must be done in c#

Question 4 (9 marks) a) (2 marks) Draw the binary heap that is represented by the following array A 10 40 20 5070603080 4 b) (4 marks) Using the BuildHeap method, rebuild A where higher values have higher priority c) (3 marks) Consider the (partial) definition of the generic class PriorityQueue implemented as a binary heap. Briefly describe the purpose of the method Mystery class PriorityQueue where T : IComparable private T[ A; private int cont private int capacity; the capacity of A // the number of items in A public void Mystery (int i)\ if (count> 0) A[i- A[count]; count count 1; PercolateUp(i); PercolateDown(i);I/ from position i // from position i Question 4 (9 marks) a) (2 marks) Draw the binary heap that is represented by the following array A 10 40 20 5070603080 4 b) (4 marks) Using the BuildHeap method, rebuild A where higher values have higher priority c) (3 marks) Consider the (partial) definition of the generic class PriorityQueue implemented as a binary heap. Briefly describe the purpose of the method Mystery class PriorityQueue where T : IComparable private T[ A; private int cont private int capacity; the capacity of A // the number of items in A public void Mystery (int i)\ if (count> 0) A[i- A[count]; count count 1; PercolateUp(i); PercolateDown(i);I/ from position i // from position

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!