Week 5: Generic Containers

SLOs for Week 5

By the end of this unit, students will be able to…

  • describe when appending to a dynamic array is “inexpensive” and when it is “expensive”.
  • reason about the difference between a dynamic array’s size and capacity.
  • explain what a class template is to his or her grandma or grandpa.
  • explain the reasons for creating class templates instead of classes.
  • understand the Time Complexity terms linear time and constant time and amortized constant time.
  • reason about the time complexity for operations on a dynamic array (append, insert, remove, copy constructor).

Slides, videos, and application exercises

Week 5: Slides

No readings for Week 5.

Lab 5: Generic Containers (Templates)

Generic Containers (Templates)

Project 4: Vec – A First Dynamic Data Structure

Vec – A First Dynamic Data Structure