Question: Assignment - 5 : Heap Write a program which manages heap, where the elements of heap are geometries. It is arranged with the area of

Assignment -5: Heap
Write a program which manages heap, where the elements of heap are geometries.
It is arranged with the area of geometry. The program supports the following
functions:
inserting a geometry:
action: insert a geometry and arrange the heap by the area of geometry
input format: I t {geometry}
t: type of geometry among c for circle, r for rectangle, s for square
{geometry} field depends on the type of geometry (as given t )
c x y r //( x,y) for center, r for radius
rx1y1x2y2////(x1,y1) for left bottom comer and ( x2,y2) for right top corner
sxy!////(x,y) for left bottom corner and 1 for side length
output: none
get the largest area
action: remove the geometry from the heap and print its area
input format: get
output format: area of the removed geometry (two floating point values) and
0.00 if no geometry is in the heap.
Example
We assume pi=3.14
Neither STL nor any libraries are allowed. This program should be implemented
from scratch not by using any butl-in libraries or functions
NO USE OF CHAT GPT IS ALLOWED!!!
Assignment - 5 : Heap Write a program which

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