Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write code in C++ , have a screen shot for output would be great 1 Setting You are already provided with a binary heap,
Please write code in C++ , have a screen shot for output would be great
1 Setting You are already provided with a binary heap, that handles some operations. So far, there is code for "insert", "findMax", and "print". So you already have the code to construct the heap. The I/O format has been fixed. The input and output files are given as command line arguments. Each line of the input file is an operation on the binary heap. The "print" operation leads to printing the heap as an array) in the output file. For this test, you will have to implement one of the functions described below. You cannot store the heap in some other data structure. You must manipulate the heap directly to perform these functions. 1.1 The test questions There are only one operation that you need to study for the test. void extractMax(). This is just the standard extract maximum function in a binary heap. It would be useful to code up the heapify function as well. (You are only provided with the header declaration for extractMax.)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started