2.3 Define and implement functions for simple Abstract Data Types (ADT)
Description
This module discusses just the simplest ADTs.
(Goodrich2011)Ch01P05: C++ Classes
(Goodrich2011)Ch06P01: Vectors
(Goodrich2011)Ch06P02: Lists
(Goodrich2011)Ch06P03: Sequences
2.3.1. Define stack as an ADT
2.3.2. Define a deque as an ADT
2.3.3. Define a list as an ADT
2.3.4. Define a sequence as an ADT
2.3.5. Define a binary tree as an ADT
2.3.6. Define a map as an ADT
2.3.7. Understand how one ADT can have different implementations
2.3.8. Implement data structures in arrays
2.3.9. Implement data structures with pointers
2.3.10. Understand advantages of encapsulation and hiding implementation details
2.3.11. Indentify the main container classes typically implemented by data structure libraries
- Identify the key manipulations (initialize, sort, search, transform) on containers
- Identify the iterators and ways to visit each element in a container for custom processing
2.3.12. Understand representation invariants (rep invariants)
- Understand the representational exposure
- Use defensive copying, proper get/set methods, verbal contract with client classes to avoid exposure
2.3.13. Use STL to initialize vectors, stacks and maps
2.3.14. Use C++ constructs to iterate over data structures
2.4 Define OO design patterns in C++
Description
The module only lists those design patterns that are typically used with data structures. One can certainly write good code without using “Gang of Four” jargon, but it can explain the thinking behind some popular APIs and data structure libraries.
(Goodrich2011)Ch02P01: OO Goals, Principles and Patterns
(Goodrich2011)Ch05P03: Deques: Adapter Design Pattern
(Goodrich2011)Ch07P03: Binary Trees: Template Method Pattern
(Goodrich2011)Ch11P04: Sets: Template Method Pattern
2.4.1. Describe the tradeoffs between top-down and bottom-up design
2.4.2. Define the singleton OO design pattern
2.4.3. Define the factory OO design pattern
2.4.4. Define the composite OO design pattern
2.4.5. Define the template method OO design pattern
2.4.6. Use virtual functions in C++ also in factory or template method patterns
2.5 Test and debug algorithms in C++
Description
The module explains general techniques to do unit testing and system testing, code inspection, printouts, logging and debugging in order to find bugs in algorithmic software.
(Goodrich2011)Ch01P07: Writing a C++ Program
(Goodrich2011)Ch04P03: Loop Invariants
2.5.1. Identify the reasons why software can contain errors
2.5.2. Write reasonably complete set of testcases.
2.5.3. Enforce invariants and Hoare logic to your data structure manipulations
2.5.4. Use printouts and/or efficient logging
2.5.5. Analyze runtime behavior using breakpoints.