Computers and Technology, 03.04.2021 02:10 jc624826
Instructions
Submit your answers and code in Canvas. Do not submit the sample input files, submit only the .hpp and .cpp files (all of them, even if you do not modify the ones we are providing). Please put down your name in comments at the beginning of all the source code files. Include a brief README file explaining your code, especially if you implemented some of the suggestions for extra credits.
Question
Implement Max Heap and HeapSort. In assignment4.zip, we are providing you with the following files: public/ demo. cpp <-main method to try your implementation maxheap. cpp <-implementation of maxheap (only file you need to modify) maxheap. hpp <-header file inputs <-folder with several sample inputs
To compile, run $ g++ -o heapsort demo. cpp maxheap. cpp .To test your implementation with a sample input file, run $ ./heapsort inputs/input. 10.1 This will test a few methods (you need to check the maxheap after each step manually) and run heapsort (the code will check whether the output is sorted automatically).
To test your implementation with all sample files with one command, run time for f in inputs/input. 10*; do echo $f; ./heapsort $f; done The command time will let you know how long it took to run the code. You may want to store the output in a file so that you can look at it carefully: time for f in inputs/input. 10*; do echo $f; ./heapsort $f; done > output Grading If you implement all the methods in maxheap. cpp properly (i. e., the demo works for any sample input), you will get 100. You also have a few opportunities to earn extra credits:
Implement and test additional methods. For example, implement and test deleteMin.
Answers: 2
Computers and Technology, 22.06.2019 10:00
Create a word problem that involves calculating the volume and surface area of a three-dimensional object. cube: surface area 6 s2 , volume s3
Answers: 3
Computers and Technology, 23.06.2019 19:50
Which feature is selected to practice and save the timing of a presentation
Answers: 1
Computers and Technology, 23.06.2019 23:30
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
Instructions
Submit your answers and code in Canvas. Do not submit the sample input files, submit o...
Spanish, 13.03.2021 03:50
Mathematics, 13.03.2021 03:50
Mathematics, 13.03.2021 03:50
Mathematics, 13.03.2021 03:50
Mathematics, 13.03.2021 03:50
History, 13.03.2021 03:50
Mathematics, 13.03.2021 03:50