CSIS 10B
Assignment 10 Stacks and Queues
Due: next Wed
In class Demos (0 points)
We develop vector based implementations of Stack and Queue classes:
1)
2)
3)
4)
discuss Big-O of various operations
consider alternatives
practice creating and modifying stacks and queues
compare stack vs queue based maze exploring algorithms
Assignment (10 points) Do either Basic or Advanced
Basic -- do all these exercises in lab10 folder inside mod10 download
Part I – Develop linked node implementations of Stack and Queue classes
1. Code your implementations to be generic
2. Test your implemementations with code provided
Part II – Application: Choose either Lab 10.5 Stack Based Language or Lab 10.6 Web Crawler
1) Both labs have starting folders within the demo10 folder
2) For Lab10.5 the Basic solution only needs to implement parts 1 thru 5. That is, the following
commands: pstack, add, sub, mul, div, dup, exch, eq, ne, pop, quit
3) Choose the lab you will complete and COPY THE FILES from the demo10/lab folder into your
lab10 folder. DO NOT copy the FOLDER into your lab10 folder because the homework
uploader will not extract subfolders from your jar files. In other words, all your lab files
should be in one folder, lab10.
Part III – Add a picture of these stacks and queues after the following statements have been executed to
the bottom of your SQTester.java file in lab10
1) StackLink<String> s = new StackLink<String>();
s.push("a");
s.push("b");
s.pop();
s.push("c");
s.push("d");
s.pop();
2) QueueLink<Integer> q = new QueueLink<Integer>();
for (int k=0; k<4; k++){
q.enqueue( (Integer)k*100);
q.dequeue();
q.enqueue((Integer)(k+1)*100);
}
Advanced: (1 point extra credit)
Implement Symbols in the stack language processor (Step 6) AND procedures and if statements as
described in the Thought Questions section of the lab.
© Copyright 2025 Paperzz