Difference between revisions of "IB Computer Science 2"
From WLCS
Line 1: | Line 1: | ||
+ | == Monday (1/3/11) == | ||
+ | '''Warmup:''' | ||
+ | * Convert from hexadecimal to binary: ADD0BEEF | ||
+ | * Convert from binary to hexadecimal: 111001011100000011011101 | ||
+ | * Assume 8-bit sign-magnitude, convert -13 from decimal to binary | ||
+ | * Assume 8-bit 2's complement, convert -20 from decimal to binary | ||
+ | |||
+ | '''Agenda:''' | ||
+ | * [https://spreadsheets.google.com/viewform?formkey=dHlCd2dMOGxMc29VU1VuakVDOW5fSHc6MQ Dossier Progress Check] | ||
+ | |||
+ | * 2nd Quarter Exam will be Friday (1/7/11)! | ||
+ | ** Basic Java programming | ||
+ | ** Stacks | ||
+ | ** Queues | ||
+ | ** Linked Lists | ||
+ | ** Binary Trees | ||
+ | ** Software Development | ||
+ | ** Big-O algorithm evaluation | ||
+ | ** Binary | ||
+ | ** Hexadecimal | ||
+ | ** Binary Addition | ||
+ | ** Sign-Magnitude Negative Binary Numbers | ||
+ | ** 2's Complement Negative Binary Numbers | ||
+ | ** Binary Subtraction (same as Binary Addition but with 2's complement negative) | ||
+ | |||
+ | * So what the heck does '''digital''' mean? | ||
+ | ** [[Media:AnalogDigital.ppt]] | ||
+ | |||
+ | * Go through your dossier code and clean it up according to "Good Programming Style" | ||
+ | * C1: Good Programming Style - [[Media:CriterionC1_goodProgrammingStyle.doc]] | ||
+ | |||
== Tuesday (12/21/10) == | == Tuesday (12/21/10) == | ||
'''Agenda:''' | '''Agenda:''' |
Revision as of 11:58, 3 January 2011
Contents
- 1 Monday (1/3/11)
- 2 Tuesday (12/21/10)
- 3 Friday (12/17/10)
- 4 Wednesday (12/15/10)
- 5 Monday (12/13/10)
- 6 Thursday (12/9/10)
- 7 Tuesday (12/7/10)
- 8 Friday (12/3/10)
- 9 Wednesday (12/1/10)
- 10 Monday (11/29/10)
- 11 Monday (11/22/10)
- 12 Thursday (11/18/10)
- 13 Tuesday (11/16/10)
- 14 Friday (11/12/10)
- 15 Friday - Tuesday (11/5/10 - 11/9/10)
- 16 Wednesday (11/3/10)
- 17 Tuesday (11/2/10)
- 18 Archives
Monday (1/3/11)
Warmup:
- Convert from hexadecimal to binary: ADD0BEEF
- Convert from binary to hexadecimal: 111001011100000011011101
- Assume 8-bit sign-magnitude, convert -13 from decimal to binary
- Assume 8-bit 2's complement, convert -20 from decimal to binary
Agenda:
- 2nd Quarter Exam will be Friday (1/7/11)!
- Basic Java programming
- Stacks
- Queues
- Linked Lists
- Binary Trees
- Software Development
- Big-O algorithm evaluation
- Binary
- Hexadecimal
- Binary Addition
- Sign-Magnitude Negative Binary Numbers
- 2's Complement Negative Binary Numbers
- Binary Subtraction (same as Binary Addition but with 2's complement negative)
- So what the heck does digital mean?
- Go through your dossier code and clean it up according to "Good Programming Style"
- C1: Good Programming Style - Media:CriterionC1_goodProgrammingStyle.doc
Tuesday (12/21/10)
Agenda:
- Return Binary Quizzes
- Media:NegBinarySignMag.ppt
- Media:NegBinary2sComp.ppt
Homework:
- Winter Break - Complete your Dossier code
Friday (12/17/10)
- Binary Quiz
- Work on Dossier projects!
Wednesday (12/15/10)
Warmup:
- Dossier Progress Check
- Show code completion of the following pieces of your dossier:
- Basic container class (e.g. Contact)
- Node class (e.g. ContactLLNode or ContactBTNode)
- Partial completion of your major data structure (e.g. ContactLL or ContactBT)
Agenda:
Monday (12/13/10)
Warmup:
- List all the Big-O complexities in order from fastest to slowest. Hint: There are 7 you should know.
- For at least 2 of the above complexities, give an example of the algorithm that has that complexity
Agenda:
- Final AddressBook demoes?
- Introduction to Binary - Media:Binary.ppt
- Introduction to Binary #2 - Media:Binary2.ppt
- Binary Games
- Binary Quiz on Friday (12/17/10)
- Dossier Progress Check on Wednesday (12/15/10)
- You will demo / present completion of the following components in your dossier:
- Basic container class (e.g. Contact)
- Node class (e.g. ContactLLNode or ContactBTNode)
- Partial completion of your major data structure (e.g. ContactLL or ContactBT)
- You will demo / present completion of the following components in your dossier:
Thursday (12/9/10)
Agenda:
- BT AddressBook demoes
- Algorithm Evaluation - Big O!
Tuesday (12/7/10)
Warmup:
- List the stages of the software development life cycle
- List 3 different methods of data collection for the Analysis stage
Agenda:
- Turn in Dossier: B2 - Data Structures
- Final demoes for LLAddressBook
- BT AddressBook demoes
Friday (12/3/10)
Agenda:
- Dossier - Data Structures due Tuesday (12/7/10)
- Demo AddressBook 2
- Create 3 new classes called ContactBinaryTreeNode, ContactBinaryTree, and ContactBTTestMain
- Media:BinaryTreeNode.java
- Media:BinaryTree.java
- Media:BinaryTreeTestMain.java
- Convert the 3 given binary tree classes to use Contacts instead of ints
- Create and demo a BinaryTreeAddressBook
Wednesday (12/1/10)
Warmup:
- Insert the following numbers into a binary tree: 45, 23, 12, 87, 54, 52, 12, 0
- How many comparisons does it take to find the number 54? (Remember to start at the root)
- How many comparisons does it take to find the number 12? (Remember to start at the root)
- What is the most number of comparisons that it takes to find a number? (Remember to start at the root)
Agenda:
- AddressBook 2 Demo
- Remove
- Prompt the user for a name
- Find the Contact in the LinkedList
- Use the LinkedLists's remove method to remove it
- Sort
- Use the SelectionSort algorithm
- You will need to convert the loops to traverse a LinkedList
- When swapping a Contact with the front, do not swap nodes, but just the Contacts inside them
- Edit
- In the Address menu, you will need to ask the user which Contact they want to edit
- Search for the Contact, and then prompt the user which field they want to edit
- Prompt the user for the new information and use the Contact's setter method to change the particular field
- Create 3 new classes called ContactBinaryTreeNode, ContactBinaryTree, and ContactBTTestMain
- Media:BinaryTreeNode.java
- Media:BinaryTree.java
- Media:BinaryTreeTestMain.java
- Convert the 3 given binary tree classes to use Contacts instead of ints
- Create and demo a BinaryTreeAddressBook
Monday (11/29/10)
Warmup:
- Insert the following numbers into a binary tree: 3, 7, 21, 34, 9, 8
- Insert the following words into a binary tree: the, quick, brown, fox, jumps, over, the, lazy, dog
Agenda:
- AddressBook 1 Demo
- add, print, search
- AddressBook 2 Demo
- remove, sort, edit
- Binary Tree Review
- 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
Monday (11/22/10)
Warmup:
- Demonstrate adding, searching, and printing to your AddressBook using LinkedLists
Agenda:
- Add removing and sorting to your AddressBook
- Removing: Prompt the user for a firstname and lastname, create a temporary Contact, search for the index of the matching Contact
- Sorting: Use either the selection-sort or bubble-sort algorithms. When you need to swap, swap Contacts, not Nodes
- Add editing?
- Binary Trees continued...
Thursday (11/18/10)
Warmup:
- Look at the board, identify the invalid node in each binary tree. Where should the invalid node go in order for the tree to be valid?
Agenda:
- Review setters/getters
- Review using methods of objects
- Complete and demo a working AddressBook that uses LinkedList
- How do we add sorting to our AddressBook?
Tuesday (11/16/10)
Warmup:
- Create a new class named ContactNode
- It should have two attributes:
- Contact c = null
- ContactNode next = null;
- It should have two constructors
- Default constructor: ContactNode()
- Specific constructor: ContactNode(Contact newC)
- You should make setters and getters for the attributes
Agenda:
- 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 Contact[] array
- Be sure to test your AddressBook with LOTS of contacts
- HINT: Use a loop to auto-create 100s of Contacts and auto-add them
- Introduction to Binary Trees
Friday (11/12/10)
Agenda:
- Demo your completed 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 Contact[] array
- Be sure to test your AddressBook with LOTS of contacts
- HINT: Use a loop to auto-create 100s of Contacts and auto-add them
Friday - Tuesday (11/5/10 - 11/9/10)
Agenda:
- Demo Media:DynamicStack.java
- Demo Media:DynamicQueue.java
- Introduction to Linked Lists
- Media:LinkedList.java
- Attributes: head, tail, size
- Constructors: default
- Methods:
- boolean isEmpty() - returns true if the LinkedList is empty, and false otherwise
- void append(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
- int getNum(int index) - returns the num found at the index (HINT: you'll need to traverse the LinkedList)
- int search(int num) - returns the index of the Node with num (returns -1 if num not in list)
- void print() - traverses the LinkedList and prints out each Node's data
- Test your LinkedList using Media:LinkedListTestMain.java
Wednesday (11/3/10)
Warmup:
- Draw the memory diagram after the following code executes:
<source lang="Java"> Node head = new Node(14); Node tail = head; tail.next = new Node(15); tail = tail.next; head.next.next = new Node(926); tail = tail.next; tail.next = new Node(3); tail = tail.next; </source>
Agenda:
- Turn in your Prototype Solutions
- Return all papers
- Demo your Media:DynamicStack.java
- Review Dynamic Queue
- Memory diagrams for each method
- Begin/Starting scenarios for each method
- 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
- Complete and demo Media:DynamicQueue.java
Tuesday (11/2/10)
- Teacher Work Day