AP CS Assignments
Assignments by week:
Fall Term:
Winter Term:
Spring Term:
Monday, January 14
Description
Finishing Linked Lists
Homework
Tuesday, January 15
Description
Stacks
Homework
  • Download the stack-implementation lab kit. Complete the two classes called LinkedStack and ArrayStack that implement the AP Stack interface using a non-resizable array and a singly-linked list (respectively) as the means of storage. All implemented methods must run in O(1) time (note that the array is non-resizable to meet this requirement, so you should throw an exception if the stack is full). Due at the end of class on Thursday. I have provided very basic unit tests to get you started. It is up to you to correctly implement and test your code fully.
Thursday, January 17
Description
Stack Usage: RPN
Homework
  • Download the PostfixCalculator Evaluator lab kit, and complete the evaluate() method in the Evaluator class. There are some basic unit tests with some example evaluations; feel free to copy and edit those to make your own tests. Due at the end of next class.

    Hint: you can use the built-in Java Stack class and use that in your program to store the operands (numbers). You do not need to use the code you just turned in (that way, any bugs you might have won't affect you here). To create a stack using the built-in types, try:

    Stack<Double> s = new Stack<Double>();

Friday, January 18
Description
Finishing RPN
Homework