Difference between revisions of "IB Computer Science 2"
From WLCS
Line 56: | Line 56: | ||
== Archives == | == Archives == | ||
+ | * [[IBCS2 - 1617 - October]] | ||
* [[IBCS2 - 1617 - September]] | * [[IBCS2 - 1617 - September]] | ||
* [[IBCS2 Summer Assignment]] | * [[IBCS2 Summer Assignment]] | ||
* [[IBCS2 - 1516]] | * [[IBCS2 - 1516]] |
Revision as of 16:58, 9 November 2016
Contents
Thursday (11/10/16)
Agenda:
- Node references review
- Stack before-and-after visualizations
- Java - Dynamic Stack Assignment
Monday (11/7/16)
Agenda:
- Node Quiz
- Closed-note, closed-book
- Use a pencil!
- If you wish to turn in any missing work, then you must e-mail me your code for review
- Work on Dynamically-sized Stacks
- Dynamic Stack Visualization
- Load the Dynamic Stack Visualization. Considering the following questions and use the visualization tool to help you answer them.
- What does an empty stack look like? (The top reference variable is null)
- For each of the following actions, assess what the picture looks like Before? then After?
- push(4)
- push(2)
- pop()
- pop()
- Create a new class called DynamicStack
- What attribute must we keep track of when we talk about stacks? (Hint: rhymes with "mop")
- Create a Node reference for the most important stack attribute
- Implement void push(data) using Nodes.
- push() should not return anything
- push() creates a new Node with the data parameter, and set the new Node's next reference to the top
- Don't forget to update the top to be the new node!
- Implement int pop() using Nodes
- pop() removes the value on top of the stack, return it
- pop() should also update the top
- pop() returns null if the stack is empty
- Implement isEmpty() which returns true if the stack is empty, and false otherwise
- Implement print() which should print your entire stack from top down (to null)
- TEST YOUR STACK
- Be sure to push A LOT of data to test the dynamic size
- Also test popping A LOT of data to make sure it works too
Thursday (11/3/16)
Agenda:
- Circular Queue walk-through
- Object and References Review
- Node class
- Node Quiz on Monday (11/7/16)
- Be able to trace code and draw memory diagram
- Be able to write code that creates a given memory diagram
Tuesday (11/1/16)
Agenda:
- Complete & demo Java - Static Queue Assignment