Question: C++. How to load text file with inputs into MAX-HEAP by reading line by line from the file. For example the text file name is

C++. How to load text file with inputs into MAX-HEAP by reading line by line from the file. For example the text file name is input1.txt How to access these inputs into an array and load into Max Heap?

sample Input1.txt is:

(line 1) 2

(line 2) 2

(line 3) 25 30

(line 4) 20 18

(line 5) 11 15

I want to only access lines 3-5 where the first numbers are the address and second is the value of the element.

and . So to load into MAX HEAP do you load both the address or just the value. Please implement it by code c++. Will be given thumbs up for correctly running code! ASAP pls

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!