$30
Lab Programming Assignment #3
Points possible: 20
Submission Requirements:
You can work in teams up to 3. If working in teams, only one person should submit the required
file. However, all team member names need to be listed within the Java file, as a comment at
the top.
o If working in a team, adhere to social distancing and collaborate remotely over the
phone and internet.
You should submit just one file, and that file’s name should be:
o BuildMaxHeap.java
Submitting a file with any other name will get you points deducted. Do not zip the file either.
Because the Java file name should be what’s listed above, the top level class name within it
should also be named BuildMaxHeap
Within the java file, include your name (at the top as a comment). If working in a team, the full
names of all team members must also be within the Java file (at the top as a comment).
Submit the Java file to BeachBoard. No email submissions will be accepted.
The project must be in the Java programming language.
I should be able to both pass in arguments and run your program via the command line.
Program Requirements:
Implement Build Max Heap using an array. It must output the following:
1. The input sequence.
2. The output max heap sequence.
3. Height of the max heap.
Note that your output will not be a sorted array. It will be a max heap, with the highest value in
A[0].
It must be able to support up to 10 integers.
Since this is Build Max Heap, you must implement Max-Heapify.
Use the algorithms from the book. Although it may need some modifications as the indices in
Java start at 0 instead of 1.
Your algorithm should also be able to support just one element as your input, as well as
duplicates.
Executing your program should be done via the command line. If I cannot both run your
program and pass in my test cases through the command line, you will get a lot of points
deducted, up to and including receiving zero credit.
After executing your program via the command line, I should see the following (the below input
and output array values are just examples):
java BuildMaxHeap 4 5 1 7 3 3 8
Max Heap Array:
8 7 4 5 3 3 1
Height: 2
Comment your code enough so that in case it doesn’t work, I can see what you’re trying to do and
possibly give you partial credit.
Failure to follow the above requirements may result in substantial points deduction, up to and
including receiving zero credit. I recommend you read the instructions more than once to ensure your
program meets the requirements.
Grading Guidelines:
Does the program meet the requested requirements/criteria?
Are the submission instructions followed?
Is your code properly commented?
Does your code compile?
Does your code pass my test cases?