Computer Science 433
Programming Languages

Fall 2012, The College of Saint Rose

Program/Problem Set 7: Datatpes, Expressions and Assignments
Due: 11:59 PM, Tuesday, November 27, 2012

1. Sebesta Problem Set Exercise 15, p. 314. (3 points)

2. Sebesta Problem Set Exercise 21, p. 315. (3 points)

3. Sebesta Programming Exercise 7, p. 316. (5 points)

4. Sebesta Problem Set Exercise 4, p. 343. (2 points)

5. Sebesta Problem Set Exercise 13, p. 344. (4 points)

6. Sebesta Programming Exercise 9, p. 346. (4 points)

7. (4 points) Consider the following memory allocation of linked lists. head and ptr are stack (local) variables that point to list nodes. List nodes were allocated in heap memory, and each list node consists of a value (an int) and a pointer to another list node. A / through a pointer field indicates a null pointer.

a. If a garbage collection operation executes, what memory can be reclaimed?

b. If the head variable goes out of scope and a garbage collection operation executes, what memory can be reclaimed?