Week 10: STL

Deadlines This Week:

  • Friday 11:59 Lists CPPLab
  • Friday 11:59 Sets/Maps CPPLab
  • Sat 11:59 Algorithms CPPLab
  • Sat 11:59PM - Quiz 4: Quiz open in elearn Thurs-Sat covering weeks 8-10
  • Sunday 11:59 - Assignment 8. Late work will not be accepted for the final assignment.

Final Notes

Online students - Schedule a time to take the final Monday-Wed of finals week. See discussion board for details The final will be pen and paper. Most questions will be writing code, though you may be asked to write an explanation of something. Here are the BIG ideas you should feel confident writing code on/answering questions about:
  • Objects & Composition
  • Inheritance, Polymorphism & Virtual Functions
  • Pointers & Shared memory
  • Container classes - especially memory management (copy ctor, destructor and assignment operator)
  • Templated functions/classes
  • Recursion
  • Pointer Based structures (LinkedLists)

Learning objectives:

Upon finishing this week, you should be able to:
  • Use std::map to store data
  • Use std::algorithms

Class Recaps:

Monday
  • Std::List
  • Review (from online supplemental chapter) 22.1, 22.2, 22.5.
  • Do Std::List CPPLab
Tuesday
  • Sets & Maps
  • Read 22.6.1 - 22.6.2 on sets and maps
  • Do Set/Map CPPLab
Wednesday
  • Std::Algorithms
  • Read 23.1-23.3. Use the rest of Ch 23 as reference - don't worry about reading/memorizing them all, just get used to the kinds of things you can do.
  • Do Algorithms CPPLab
Friday
  • Study Hall
  • Take Quiz 4 Online

Online Activity Outline:

STL Basics

  • The STL is a collection of generic (templated) largely focused on storing and working with collections of data. Our goal for CS162 is to learn about becoming consumers of data structures. As a practical programmer in C++ (or Java, C#, etc...) if you want to store a collection of things, a plain array is often not the best tool.
    CS260 is largely about learning how the structures in the STL (and similar libraries for other languages) are implemented and why those implementations are used. But, most languages provide prebuilt implementations of these structures - the STL is that library for C++
  • Read Learncpp.com 16.1-16.2 - good high level overview
    or/and
    Liang Ch 22.1-22.2 - slightly more detailed view

Lists

  • Read 22.5
  • Do Lists CPPLab

Sets & Map

  • Read 22.6.1-22.6.2 on sets and maps. Watch this video:
  • Do Maps/Sets CPPLab

STL Algorithms

  • Read Learncpp.com 16.4 for a high level intro to STL algorithms
  • Do the Ch23 reading (23.1-23.2, skim the rest as you do CPPLabs)
  • Watch this video:
  • Do Algorithms CPPLab
  • Don't forget to take the final quiz!
  • Extra Info:

    cplusplus.com

    cplusplus.com has a great algorithm reference with examples of different algorithms in use

    Learncpp.com

    This online tutorial covers a limited portion of the same ground as the Liang readings:
    LearnCpp.com chapters 16.1-16.4

    Assignment:

    Assignment #8 (due Sunday before finals week). Late work will not be accepted for the final assignment.

    Classroom slides/examples:

    Directory of classroom files from the week
    Right click files and save to your computer