Previous Lecture | Lecture 7 | Next Lecture |
Lecture 7, Tue 04/23
Midterm 1 Review
Logistics
- Bring studentID and writing utensil
- No electronic devices
- No notes, no books
Format
- Will be a mix of questions based on lectures, homeworks, readings, and labs.
- Short Answer
- Briefly define, describe, state, ...
- Write code (includes makefiles)
- Fill in the blank / complete the table
- Given code, write the output
- Given a statement, tell me if it's true / false
- if false, briefly state why
- Expect it to take ~ one hour (maybe sooner)
- but we have the entire class period
- Will cover a broad range of topics, but probably not everything
Topics
- Will cover everything up to Thursday's lecture (4/18)
Makefiles
- Know how to create one when multiple files are linked to form an executable
- Know the build process
- Proprocessing, Compiling, Linking
- Creating and using variables
- Know what the default rules are, flags, special symbols (as discussed in lecture)
Standard Template Library
- Reviewed some details about vectors
- Operations like [], at, front, back, pop_back, push_back, size, constructors, ...
- STL container iterators
- std::vector, std::map, std::set,(std::unordered_map, std::unordered_set)
- begin(), end(), ++, <, *, erase
- Using iterators in container methods as discussed in lecture.
Class Design
- Abstract Data Types
- How to design an interface (.h file) and its implementation (.cpp)
- Public vs. Private
- Accessors (getters) vs Mutators (setters)
- Constructors (default, overloaded, copy)
- Header guards
- Scope Resolution operator (::) and .cpp method definitions
- Shallow vs. Deep Copy
- Big Three (Rule of Three): copy constructor, destructor, assignment operator
Structs and Classes
- What are the difference(s)?
- Memory Padding (how they are stored in memory)
Namespaces
- Avoid naming collisions
- How to create namespaces in your code
- Global namespace (how to specifiy using "::")
Quadratic Sorting Algorithms
- bubbleSort
- Optimized version
- selectionSort
- insertionSort
- Know the algorithms as discussed in lecture
- Know the running times.
Hash Table Topics
- Know basics of hash functions and performance of various operations
- open-address hashing / double-hashing / chained-hashing
- std::map vs std::unordered_map
- Implementation details