CS 112
Lecture 21
Homework and administrative matters
- Homework 7 back (8, by tonight).
- Queues, airport runways and your code: the case for reliable
software.
Would you feel safe knowing that your airplane is about to land
on an airport, where the landing queue is guided by software you
wrote? How thoroghly would you test your code in such a case? Who
thinks that her Queue class is robust enough to pass such a test?
- Extra credit, for making up missed work:
implement sorting using binary search
trees. Need to write a function to construct the binary search
tree from an input array of numbers, then traverse the tree in
infix order. The specifications are vague, you have the freedom
to design it as you want. But I suggest that you reuse code
written for other homeworks, such as the Binary Tree class and
the tree
traversal algorithms. You should package everything with a nice
testdriver, test thouroughly and submit the usual files
(including the typescript).
This extra-credit problem is due by Friday, May 5th (the last day
of the exam period). This is a firm deadline, set by the
college, and I do not have the right to grant any extension
beyond it. You have to notify me by email if you want to submit a
solution to the extra credit problem, and I will create a special
directory for these submissions.
Another (alternative) extra credit problem is listed at the end
of the final project. That is harder, in the sense that it builds
on the final project - or easier, meaning that if you do the
final project well, than with a few extra modifications you will
also get the extra credit. I leave it to you to choose which one
you prefer to do, if you need to.
Wrap-up, lists and trees
Discussion
- doubly linked lists
- binary trees with pointers
to parent
- general (non-binary) trees.
Getting started on the final project:
Graphs and graph traversal
- Graphs. Trees as special cases of graphs.
- Adjacency list representation. How the
representation relates (or not) to the representation of (general, not
binary) trees. Directed and undirected graphs.
- Implementation of a (Directed) Graph data structure: basic ideas. The
complete class and struct definitions are part of next homework.
- Homework 10
Ileana Streinu