IBCS2 - 1516 - November

From WLCS
Revision as of 20:53, 6 November 2016 by Admin (talk | contribs)

Friday - Tuesday (11/20/15 - 11/24/15)

  • Demo DynamicQueue
  • Introduction to Linked Lists (walk-through)
    • Data Structure Visualizations
    • What does a Linked List look like?
    • Linked List attributes
      • first
      • last
      • size
    • Linked List methods
      • adding data (beginning, middle, end)
      • deleting data (beginning, middle, end)
      • getting data
      • modifying data
      • searching for data
      • clearing all data
    • Complete LinkedList assignment posted on Google Classroom

Wednesday (11/18/15)

Agenda:

  • Finish DynamicStack walk-through
  • Testing DynamicStack
  • Dynamically-sized Queues - complete by the end of today
    1. On paper, draw the before-and-after pictures for enqueue()'s 2 scenarios:
      1. enqueueing to an empty queue
      2. enqueueing to a non-empty queue
    2. Draw the before-and-after pictures for dequeue()'s 3 scenarios:
      1. dequeueing an empty queue
      2. dequeueing the very last node
      3. dequeueing normally when the queue has more than one node
    3. Write the dynamically-sized queue code
      1. Use a combination of the StaticQueue and DynamicStack as templates
        • i.e. implement all the methods from StaticQueue (except for isFull())
      2. Be sure to test your DynamicQueue like the DynamicStack

Monday (11/16/15)

Agenda:

  • Node Quiz!
  • Dynamically-sized Stacks
    • Data Structure Visualizations
    • Stack scenarios and Before-&-After pictures
      1. What are the possible behaviors of a stack?
      2. What does the picture look like Before?
      3. What does the picture look like After?
    • Create a new class called DynamicStack
    • What attribute must we keep track of when we talk about stacks?
    • 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, 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/12/15)

Agenda:

  • Stacks and Queues Quiz
  • IDT Programming Contest meeting today for team registrations
  • Dual Enrollment for NVCC CSC201
  • Node review
  • Node Quiz on Monday (11/16/15)
    • Be able to trace code and draw memory diagram
    • Be able to write code that creates a given memory diagram
  • Work on Dynamically-sized Stacks
    • Dynamic Stack Visualization
    • Stack scenarios and Before-&-After pictures
      1. Load the Dynamic Stack Visualization. Considering the following questions and use the visualization tool to help you answer them.
      2. What does an empty stack look like? (The top reference variable is null)
      3. 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

Monday (11/9/15)

Agenda:

Monday - Thursday (11/2/15 - 11/5/15)

Warmup:

  1. List and describe the stack operations (names of methods and what they do)
  2. List and describe the queue operations (names of methods and what they do)

Agenda: