CSE 428 : Solution of Assignment #3
Grading policy
The grading of Exercise 1 has been done accordingly to what was written in the text of the assignment.
The other two exercises have been graded as follows:
- Exercise 2: 4 points each subproblem, 2 for ML and 2 for DP. Deduct
1 point if the DP pointer to the wrong place (stack or heap).
- Exercise 3: deduct 10 points if there is no seperation of stack and
heap or similar big mistakes; deduct 3 points if there is no main() part
in the stack drawing; deduct 5 points if there is no k representation in
the stack drawing; deduct 5 points if there is unwanted links between
nodes in the heap drawing; deduct 3 points if there is missing nodes in
the heap or stack drawing.
Exercise 1
Click here for the code of the solution.
Click here for the code of the test cases
used by the TA. To try your solution, save the code of the test cases
in a file A3_code_stack.C and then compile your solution
with the Unix command g++ -DT1 -DT2 -DT3 -DT4 solution.C (where
solution.C is the name of the file containing your solution).
Exercise 2
- Memory leaks: Yes. Dangling references: No.
- Memory leaks: No. Dangling references: Yes, to the heap.
- Memory leaks: No. Dangling references: Yes, to the stack.
- Memory leaks: No. Dangling references: No.
- Memory leaks: Yes. Dangling references: No.
Exercise 3