Week 8 - Templates and Array Lists

Learning objectives

Upon finishing this week, you should be able to:

  • Create and use generic functions using templates
  • Create and use generic array-based data structures
  • Describe how array based lists implement common operations

Suggested pacing

Day 1

Day 2

Day 3

  • Finish ArrayLists (Ch 23.11-23.15)
  • Do Ch 23 Exercises 2

Day 4

Activity Outline

Templates

Read Ch 23.1-23.7.

These optional videos cover the basics of templates and how to include template code in your project:

Templated functions (Ch 23.1-23.4):


Including templated code (Ch 23.5):


Templated structs and classes (Ch 23.6-23.7):

Array Lists

Read Ch 23.8-23.15.

These optional videos cover the basics and more advanced features of array lists:

Array List basics (Ch 23.8-23.10):


Array List advanced (Ch 23.11-23.14):

Regular Expressions

Regular expressions don't relate to anything else in this week. And nothing we do in the future will build on them. So on one hand they are are a non-essential detour. On the other hand, there are situations where they are an indispensable tool .

Other than a few book exercises, you won't be assessed on regular expressions. But any time you invest in learning them will likely pay off in the long run. Not only are they a useful programming tool, but they are invaluable for searching and manipulating text in editors and command line tools.

Read Ch 21.15-16

This optional video covers them:

Regex Tools and References