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 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

  1. Memory leaks: Yes. Dangling references: No.
  2. Memory leaks: No.   Dangling references: Yes, to the heap.
  3. Memory leaks: No.   Dangling references: Yes, to the stack.
  4. Memory leaks: No.   Dangling references: No.
  5. Memory leaks: Yes. Dangling references: No.

Exercise 3