IBCS2 - November
From WLCS
Contents
Tuesday (11/24/09)
Agenda:
- Dossier - Data Structures
- Media:CriterionB1_dataStructures.doc
- Demo your LinkedList AddressBook
- Create 3 new classes called ContactBinaryTreeNode, ContactBinaryTree, and ContactBTTestMain
- Convert the 3 given binary tree classes to use Contacts instead of ints
- Create and demo a BinaryTreeAddressBook
Homework:
- Demo BinaryTreeAddressBook - due (Tuesday 12/1/09)
- Dossier - Data Structures rough draft - due (Thursday 12/3/09)
Friday (11/20/09)
Agenda:
- Demo your LinkedList AddressBook. It should be able to do the following:
- add a Contact
- print list of Contacts
- find a Contact
- sort list of Contacts
- Re-Introduction to Binary Tree
- Create 3 new classes called ContactBTNode, ContactBinaryTree, and ContactBTTestMain
- Convert the 3 given binary tree classes to use Contacts instead of ints
Wednesday (11/18/09)
Warmup:
- What is the algorithm for a linear search?
- What is the algorithm for a selection sort?
- What is the algorithm for a bubble sort?
Agenda:
- int find(String fn, String ln) in the ContactLinkedList
- Add the find() option to your AddressBookMain and AddressBook
- find() in the AddressBook should use the ContactLinkedList's find() and then ContactLinkedList's getContact()
- void selectionSort() in the ContactLinkedList
- You should move the bubbleSort() into the ContactLinkedList and complete the method yourself
- Removing a Contact
- Add a remove option to your AddressBookMain
- Create a remove(String fn, String ln) method in your AddressBook
- In the method, use the ContactLinkedList's find() method to get the index of the Contact
- Check if the index is valid (not the error code), and if so, then use the ContactLinkedList's remove() method using that index
- Demo a completely working AddressBook
Monday (11/16/09)
Warmup:
- Open your Contact class and review the code
Agenda:
- Contact class review as a class
- Create a new class from your Node class and called ContactNode
- Do this as a class...quickly
- Create a new class called ContactLinkedList
- Do this as a class...quickly
- Convert your LinkedList to use ContactNode and call it ContactLinkedList
- Go through one or two examples as a class
- Be sure to test your ContactLinkedList
- AddressBook class review as a class
- Convert your AddressBook to use ContactLinkedList instead of an array
- Comment out the parts for find(), selectionSort(), and bubbleSort(). We will convert these later
- Be sure to test your AddressBook with LOTS of contacts
Homework:
- Complete the AddressBook conversion over to ContactLinkedList by Wednesday (11/18/09)
- Be ready to demo your AddressBookMain
Thursday (11/12/09)
Agenda:
- Abstract data types review
- Introduction to Binary Tree
- Demo your LinkedList
- Contact class review
- Create a new class from your Node class and called ContactNode
- Create a new class called ContactLinkedList
- Convert your LinkedList to use ContactNode and call it ContactLinkedList
- Be sure to test your ContactLinkedList
- AddressBook class review
- Convert your AddressBook to use ContactLinkedList instead of array
- Comment out the methods for find(), selectionSort(), and bubbleSort(). We will convert these later
- Be sure to test your AddressBook with LOTS of contacts
Monday (11/9/09)
Agenda:
- Turn in homework
- Demo DynamicQueue
- Introduction to Linked Lists
- Media:LinkedList.java
- Attributes: head, tail, size
- Constructors: default
- Methods:
- isEmpty() - returns true if the LinkedList is empty, and false otherwise
- void add(int num) - adds a new Node with num at the end of the LinkedList
- void add(int num, int index) - adds a new Node with num at the index specified
- There are FIVE different scenarios when you add a Node
- DRAW the before-and-after pictures for all FIVE secenarios
- int remove(int index) - removes the index-th Node and returns its data
- There are SIX different scenarios when you remove a Node
- print() - traverses the LinkedList and prints out each Node's data
- Create a main method to test out all the methods and scenarios of LinedList
Homework:
- Complete the LinkedList class and all its methods by the beginning of class on Thursday (11/12/09)
- Mr. Bui will give you his LinkedListMain on Thursday to test
Thursday (11/5/09)
Warmup:
- Draw the before-and-after pictures for adding a Node to an empty Queue (be sure to use head and tail!)
- Draw the before and after pictures for adding a Node to a non-empty Queue
- Draw the before-and-after pictures for removing a Node from an empty Queue
- Draw the before and after pictures for removing a Node from a non-empty Queue
Agenda:
- Return 1st Quarter Exams
- Dynamically-sized Queues
- Create a new class called DynamicQueue
- Test out your DynamicQueue using the original QueueMain file
- Introduction to Linked Lists
- Media:LinkedList.java
- Attributes: head, tail, size
- Constructors: default
- Methods:
- isEmpty() - returns true if the LinkedList is empty, and false otherwise
- void add(int num) - adds a new Node with num at the end of the LinkedList
- void add(int num, int index) - adds a new Node with num at the index specified
- There are FIVE different scenarios when you add a Node
- DRAW the before-and-after pictures for all FIVE secenarios
- int remove(int index) - removes the index-th Node and returns its data
- There are SIX different scenarios when you remove a Node
- print() - traverses the LinkedList and prints out each Node's data
Homework:
- Complete DynamicQueue!
- Draw the before-and-after diagrams (all SIX scenarios) for the LinkedList's remove() method
Monday (11/2/09)
Warmup:
- Assume that you have allocated memory for a new int array of 10000 elements. An int is 32-bits in size, and there are 8-bits in 1 byte. How many bytes of memory are you taking up?
- If there are 1024 bytes in a kilobyte, how many kilobytes are you taking up?
Agenda:
- Dynamically-sized Stacks
- 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 push(int num) using Nodes.
- push() should not return anything
- push() creates a new Node with the num, and set the new Node's next reference to the top
- Don't forget to update the top to be the new node!
- Implement pop(), which should POP and return the value on top of the stack and update the top
- Implement top(), which should just return the value on top of the stack
- Implement isEmpty() which returns true if the stack is empty
- Implement print() which should print your entire stack
- TEST YOUR STACK USING MR. BUI'S STACK MAIN OR YOUR OWN MAIN METHOD