C++ Course Outline and Planning

This document outlines topics to cover, problems to assign, and resources to incorporate into the C++ course.

Core C++ Topics to Cover

1. Template Specialization

Priority: High
Description: Full and partial template specialization techniques
Prerequisites: Templates, generics
Resources:


2. lvalue, rvalue, and Move Semantics

Priority: High
Description: Understanding value categories and move semantics in modern C++
Topics to Cover:

Prerequisites: Rule of Three, references, pointers
Related Topics: Rule of Five


3. Smart Pointers

Priority: High
Description: Modern C++ memory management with smart pointers
Coverage:

Prerequisites: Pointers, RAII, destructors
Resources:


4. Scoped Enums (enum class)

Priority: Medium
Description: Type-safe enumerations in modern C++

Example:

// Traditional enum (unscoped)
enum Color { black, white, red };

// Scoped enum (enum class)
enum class Color { black, white, red };
Color c = Color::red;  // Requires scope resolution

auto white = false;  // OK - white is now scoped

Advantages:


5. Member vs Non-Member Functions

Priority: Medium
Description: When to use member functions vs non-member functions
Topics:

Example:

struct Base {
    virtual void hi() { cout << "a"; }
};

struct Derived : Base {
    void hi() override { cout << "b"; }
};

void foo(Base &b) {
    b.hi();  // Polymorphic call
}

int main() {
    Derived x;
    foo(x);  // Outputs: b
    Base y;
    foo(y);  // Outputs: a
}

LeetCode Problems to Assign

Dynamic Programming

  1. Combination Sum IV
    • Difficulty: Medium
    • Topics: DP, recursion, memoization
  2. Ways to Express an Integer as Sum of Powers
    • Difficulty: Medium
    • Topics: DP, backtracking

Design Problems

  1. Design a Text Editor
    • Difficulty: Hard
    • Topics: Data structures, string manipulation
    • Skills: Class design, implementation
  2. Design an ATM Machine
    • Difficulty: Medium
    • Topics: OOP, design patterns
    • Skills: State management, operations
  3. Finding MK Average
    • Difficulty: Hard
    • Topics: Data structures, design
    • Skills: Efficient data structure design
  4. Design Parking System
    • Difficulty: Easy
    • Topics: OOP basics, simple design
    • Skills: Class design fundamentals
  5. Data Stream as Disjoint Intervals
    • Difficulty: Hard
    • Topics: Intervals, data structures
    • Skills: Complex data structure design

Already Assigned

  1. Design Circular Queue (Lecture 10/22)

Video Resources

Primary Course Videos

Supplementary Videos


Code Examples to Add

1. Virtual Functions and Polymorphism

Priority: High

#include <iostream>
using namespace std;

struct Base {
    virtual void hi() { cout << "a"; }
};

struct Derived : Base {
    void hi() override { cout << "b"; }
};

void foo(Base &b) {
    b.hi();
}

int main() {
    Derived x;
    foo(x);    // Outputs: b (polymorphic)
    Base y;
    foo(y);    // Outputs: a
}

Location: code-examples/oop/virtual-functions.cpp


2. Move Semantics Example

Priority: High

#include <utility>
#include <vector>

class MyClass {
    std::vector<int> data;
public:
    // Move constructor
    MyClass(MyClass&& other) noexcept 
        : data(std::move(other.data)) {}
    
    // Move assignment
    MyClass& operator=(MyClass&& other) noexcept {
        data = std::move(other.data);
        return *this;
    }
};

Location: code-examples/advanced/move-semantics.cpp


3. Smart Pointer Examples

Priority: High

#include <memory>

void uniquePtrExample() {
    auto ptr = std::make_unique<int>(42);
    // Automatic cleanup
}

void sharedPtrExample() {
    auto ptr1 = std::make_shared<int>(42);
    auto ptr2 = ptr1;  // Reference count = 2
}

Location: code-examples/advanced/smart-pointers.cpp


Books and References

  1. Scott Meyers Books
    • Effective C++
    • More Effective C++
    • Effective Modern C++
  2. Bjarne Stroustrup
    • The C++ Programming Language
    • Programming: Principles and Practice Using C++

Course Structure Recommendations

Week 1-4: Fundamentals

Week 5-8: Object-Oriented Programming

Week 9-12: Advanced Topics

Week 13-15: Modern C++ and Projects


Topics for Future Expansion

C++11/14/17/20 Features

Advanced Topics

Practical Skills


Implementation Notes

Slide Updates Needed

See slides/SLIDE_UPDATES.md for detailed recommendations.

Assignment Ideas


Last Updated: January 2026
Course: CPP-S26
Maintainer: Course Instructor