|
|
(135 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | == Thursday (10/3/19) ==
| |
− | '''Agenda:'''
| |
− | * Complete Queue (array implementation) and submit to repl.it
| |
− | * If you have completed the Queue, then implement the circular queue data structure. Be sure you save as a new project or file and rename the class to CircularQueue. Do not overwrite your original queue code!
| |
− | * Mini queue quiz in the last 15 minutes of class
| |
− |
| |
− | '''Homework:'''
| |
− | * Watch https://www.youtube.com/watch?v=N8IeMYsdgAY for review
| |
− |
| |
− | == Tuesday (10/1/19) ==
| |
− | '''Agenda:'''
| |
− | * Stacks quiz
| |
− | * Submit your String Stack assignment to repl.it
| |
− | * Introduction to Queues - [https://docs.google.com/presentation/d/1Wckb8R3om4RGi9O8HWu0yYdkaFek5y0_GI1ak0H89yU/edit?usp=sharing Queues slides]
| |
− | * Play with the [https://www.cs.usfca.edu/~galles/visualization/QueueArray.html Queues Array Implementation]
| |
− | *# What attributes of a queue should we keep track of?
| |
− | *# What happens to the tail when data is added?
| |
− | *# What happens to the head when data is removed?
| |
− | * Implement the Queue class and its methods:
| |
− | ** Queue() constructors - use a default array size of 15
| |
− | ** void enqueue(int data)
| |
− | ** int dequeue()
| |
− | ** void add(int data) - this method should only have one line of code!
| |
− | ** int remove() - this method should only have one line of code!
| |
− | ** boolean isEmpty()
| |
− | ** boolean isFull()
| |
− | ** int peek() - returns the head of the queue if it's not empty; Integer.MIN_VALUE otherwise
| |
− | ** String toString()
| |
− | * Submit your queue (array implementation) to the repl.it assignment
| |
− | * Queue challenge: If you add() and remove() a bunch of times, eventually, your queue will fail to work because the head and tail will hit the end of the array. Prevent this from happening by making a "circular queue".
| |
− |
| |
− | '''Homework:'''
| |
− | * Queue (array implementation) to repl.it
| |
− |
| |
− | == [[IBCS2 - 1920 - September]] ==
| |
− |
| |
| == [[IBCS2 - Archives]] == | | == [[IBCS2 - Archives]] == |