previous | index | next

Exercise 13.13

This exercise requires a re-implementation of the queue ADT using a single two-element vector and mutable pairs for the queue elements.

The test is almost identical to that for Exercise 13.11, except that the vector length test is eliminated (since a vector is not used to represent queue elements).

When your queue ADT is implemented correctly, the output should be:

**************************************************************
Results for Exercise 13.13

Assertion OK:
(= (head queue) 5)

Assertion OK:
(= (head queue) 14)

Assertion OK:
(empty-queue? queue)

See suggestions on next slides.


previous | index | next