Java

TOPIC 26 – IMPLEMENTING A QUEUE & STACK

 

LESSON WORK

 


IF TIME PERMITS, MR. CAMPEAU WILL TRY TO DO THIS WORK WITH YOU

QUESTION 1

Implement a Stack class using a LinkedList or ArrayList object.  Essentially, you are simply creating three methods: push, pop and size. 

 

Then test your structure.

 

QUESTION 2

 

Implement a Queue class using a LinkedList or ArrayList object.  You are to create the enqueue, dequeue and size methods.

 

Test your structure.