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

Thursday (11/10/16)

Agenda:

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.
      1. What does an empty stack look like? (The top reference variable is null)
      2. For each of the following actions, assess what the picture looks like Before? then After?
        1. push(4)
        2. push(2)
        3. pop()
        4. 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:

Tuesday (11/1/16)

Agenda:

Archives