Question: As mentioned in the previous lecture, using the STL in C++, sort the given numbers in the input.txt file by only using Heap data container.

As mentioned in the previous lecture, using the STL in C++, sort the given numbers in the input.txt file by only using Heap data container. Your sorted numbers should be written to the output.txt file.

Warnings

  • In the input file, there are just integer numbers. The amount of integer numbers is not given to you. So, read the N integers in the input.txt file up to EOF.
  • Create your input.txt file by yourself.
  • Your codes can run over any input file.
  • After execution, your code should generate the output.txt file in which there are sorted numbers.
  • Your codes can be tested with an input file which contains 1 million random numbers.
  • Execution Time < 1 sec.
  • Memory limit < 64 MB

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!