lab4 - Table 4.1 on page 198 of our Textbook At the...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COMPSCI 225-002 Introduction to Computer Science II (Fall 2011) Programming Assignment #4, Due on 10/11/2011, Tuesday (11PM) Introduction: This assignment will ask you to implement a Queue ADT using two stack instance variables s 1 and s 2 . Please use TwoStackQueue to name your Queue class. The class should implement at least the following Queue methods: public boolean oFer(E item) public E remove() public E poll() public E peek() public E element() public Iterator < E > iterator() // return an iterator object that can iterate through // the queue (in the order of data items to be deQueued). The detail description of the above methods can be found in JAVA’s Queue interface, or check the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Table 4.1 on page 198 of our Textbook. At the beginning of your TwoStackQueue class, you should import java.util.Stack so that you can declare two instance variables: Stack s1, s2; A TestTwoStackQueue program will be given in the directory ∼ jhyeh/cs225/lab/p4/±les Description: Copy the ±les and expected output from ∼ jhyeh/cs225/lab/p4/±les in onyx to test your TwoStackQueue implementation. Submission: Submit your program from onyx by copying all of your java ±les to an empty directory (with no subdirectories) and typing the following ²ROM WITHIN this directory: submit jhyeh cs225 4...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online