Final Topics
This is a list of the topics we have covered since the midterm.
The midterm questions can come from any of these.
Read over the notes and review the example code.
- File I/O
How to open a file for read or write, how to tell if it didn't open.
How to read or write from/to a file.
Closing a file.
How is it different/the same as using cin or cout.
- Templates
Syntax for templates. How to use a template, that is, how to create an
instance of one.
Why are they useful.
- Standard Template Lists
Know the basic methods, push_back(), push_front(), etc.
How do these operations compare to the ones we wrote.
For example, how do I add to the front of a list?
- Iterators
How to create and use.
Know to initialize (begin()), when you are at the end (end() and
how to dereference.
How to increment.
- Stacks
Last in first out.
Add at one end, remove from same end.
Only look at top.
Good for storage and reversing.
How to do push() and pop() using a list.
- Queues
First in First out.
Add at one end, remove from the other.
Represents people standing in line.
How to do enqueue() and unqueue() using a list.
- Recursion
The rules about having a stop state and making the problem simpler.
Be able to read and evaluate a recursive function.
- Trees
Definitions. Node, child, parent, siblings, order, root, level.
Traversals, inorder, preorder, postorder.
Properties of an ordered binary tree.
Know the algorithms so you can properly add a node to a tree.
Also be able to traverse a given tree.