CSCI 202 Homework 6

Purpose

Understand how stacks and queues may be implemented.

Due dates

This assigment is to be turned in at by the February 29 class.

The assignment

Suppose the following operations are performed on an newly created stack S.

  1. S.push(202)
  2. S.push(242)
  3. S.pop()
  4. S.push(255)

With a pencil drawing, illustrate the implementation of these four operation using both the array-based implementation (Figure 7-5, p. 365) and the reference-based implementation (Figure 7-6, p. 368).

For each implementation, your answer should look a bit like four of the related figure.

You are allowed to work with others on this assignment, but the drawing you turn it must have been generated by your own hand.