This book covers the core data structures that form the foundation of efficient problem solving in computer science. You work through arrays, vectors, linked lists, stacks, queues, deques, sets, maps, trees, graphs, and hash tables, learning not just how each structure works, but when and why it should be used. Throughout the book, emphasis is placed on understanding data organization, memory behavior, and performance tradeoffs so you can reason about time and space complexity and make informed design decisions.
In addition to data structures, the book explores recursion and advanced algorithms that build on these foundations. You learn how recursive solutions rely on the call stack, how to identify base and recursive cases, and how recursion appears naturally in structures like trees and graphs. The later sections connect these ideas to searching, sorting, graph traversal, and algorithm analysis, helping you see how data structures and algorithms work together to solve complex, real-world problems efficiently and confidently.
Example Curriculum
- Source Files and Header Files
- How Multi-File Programs Work – The “Team Effort” Approach
- Best Practices for Organizing Your Projects
- Common Mistakes in Program Structure (and How to Avoid Them)
- Primitive Types – The Core Building Blocks
- Type Casting – Converting One Type into Another
- auto – Letting the Compiler Figure It Out
- Making Decisions in Your Code
- Loops – Doing Things Over and Over
- Breaking Your Code Into Reusable Pieces
- Function Overloading – Same Name, Different Job
- Grouping Related Data Together
- Passing Structures to Functions
- The Standard Template Library (STL)
- The vector STL and strings
- begin() and end() – The Loop Bookends
- Demo - Transaction Tracker (9:15)
- What is a Class
- Class Syntax and Components
- Access Modifiers: public, private, protected
- Constructors and Destructors
- Member Functions and Data Members
- Getters, Setters, and Data Encapsulation
- Demo - Car Class (4:41)
- Demo - Podcast (4:10)
- Overloading Member Functions
- Operator Overloading Basics
- Organizing Classes in Header and Implementation Files
- Video - Classes and Objects Summary (5:56)
- Demo - Bank Account (8:23)
- Testing and Debugging Class Code
- Demo - Bank Account Test Cases (5:51)
- Understanding Memory Layout (Stack vs. Heap)
- Video - Pointers (6:13)
- Pointer Basics (* and &)
- Dynamic Memory Allocation with new and delete
- Pointers to Objects
- nullptr and Pointer Safety
- Reference Variables vs. Pointers
- Demo - Pointers and References (8:43)
- Smart Pointers - Unique Pointers – Exclusive Ownership
- Demo - Unique Pointers (4:50)
- Smart Pointers - Shared Pointers – Shared Ownership
- Demo - Shared Pointers (5:11)
- Smart Pointer - Weak Pointers – Non-Owning Reference
- Demo - Weak Pointers (4:44)
- Smart Pointers Wrap-Up
- Introduction to Inheritance
- Constructors, Destructors, and the Rule of Three/Five in Inheritance
- Demo - Inheritance - Person/Student (8:59)
- Function Overriding vs. Function Overloading
- Demo - Function Overriding vs. Overloading (Shape/Circle/Square) (7:02)
- What Does Polymorphism Mean?
- Demo - Polymorphism - Inheritance and the Rule of Three (8:15)
- Abstract Classes and Pure Virtual Functions
- Demo - Abstract Class - Payment Strategy Pattern (3:43)
- Virtual Destructors and Resource Management
- Wrap-Up and Real-World Applications
- Introduction to Templates
- Why Templates Are Useful
- Function Templates
- Demo - Function Templates (3:16)
- Class Templates
- Demo - Class Templates (6:04)
- Template Specialization
- Templates with Multiple Parameters
- Demo - Template with Multiple Parameters (4:31)
- Templates and Compilation (How They Work Behind the Scenes)
- Case Studies / Real-World Applications of Templates
- Best Practices and Common Pitfalls
- Why Sorting Matters
- Bubble Sort
- Demo - Bubble Sort (3:52)
- Selection Sort
- Demo - Selection Sort (5:03)
- Insertion Sort
- Demo - insertion Sort (5:28)
- Merge Sort
- Demo - Merge Sort (5:30)
- Quick Sort
- Demo - Quick sort (6:29)
- STL's std::sort Function
- Demo - STL sort Function (6:24)
- Stability and Performance Considerations
- Lab - Comparing Sorting Algorithms
- Lab - Selection Sort with Objects
- Lab - Insertion Sort and Nearly Sorted Data
- Lab - Merge Sort for Large Data
- Lab - STL Sort vs. Stable Sort (Multi-Key)
- Lab - Comparing the Efficiency of Sorting Algorithms
- Lab - Create Your Own Struct (4 Attributes) and Sort with std::stable_sort
- Introduction to Linked Lists
- Singly Linked List Structure
- Creating Nodes Dynamically
- Demo - Singly Linked Last (3:55)
- Insertion and Deletion in a Singly Linked List
- Demo -Singly Linked List using Smart Pointers (7:31)
- Traversal and Search
- Doubly Linked List Structure
- Demo - Doubly Linked List (7:51)
- Circular Linked Lists
- Demo - Simple Circular Linked List (3:49)
- STL list Container
- Demo - STL Lists (5:36)
- When to Use Linked Lists
- Stack Concept and Use Cases
- Implementing a Stack with Arrays
- Implementing a Stack with Linked Lists
- Demo - Stack using a Linked List (6:13)
- STL Stack Class
- Demo - STL Stack (2:54)
- Queue Concept and Use Cases
- Implementing a Queue with Arrays
- Implementing a Queue with Linked Lists
- Demo - Tech Support Ticket System using a Queue (7:41)
- STL Queues and Deques
- STL Priority Queues
- Demo - Priority Queue - Urgent Tickets (5:05)
- Lab - Browser History Navigation (Using Two Stacks)
- Lab - Coffee Shop Queue Simulation (STL queue)
- Lab - Text Editor Undo/Redo (Two Stacks + Command History)
- Lab - Print Queue Manager (Linked-List Queue)
- Lab - Emergency Room Triage (Priority Queue Simulation)
- Lab - Task Scheduler with a Custom Priority Queue (Min-Heap)
- Lab - Challenge Lab - Bank Teller Queue Simulation (Queue + Statistics)
- Set Concept and Mathematical Background
- Set Theory
- STL set
- STL multiset
- Common Set Operations
- Demo - Sets - Event Guest List (6:49)
- Union of Sets
- Intersection of Sets
- Difference of Sets
- Demo - Set Operations - Shopping Cart Analysis (6:04)
- Ordered Sets
- Unordered Sets
- Demo - Ordered and Unordered Sets - Bookstore Inventory (4:57)
- When to Use Sets vs. Other Containers
- Introduction to Tree Structures
- Tree Terminology
- Binary Trees
- Binary Search Trees (BSTs)
- Demo - Binary Search Trees (BST) (9:32)
- Tree Traversal
- Demo - Binary Traversal (In order, Pre order, Post order) (10:00)
- Balanced Trees Overview
- AVL Trees
- AVL Tree Rebalance Roations
- Demo - Automatic Balancing with AVL Tree Rotations (10:12)
- Heaps and Heap Operations
- Demo - Min-Heap (6:25)
- STL Tree-Like Containers (set, map)
- Graph Terminology and Types
- Representing Graphs (Adjacency List, Adjacency Matrix)
- Directed vs. Undirected Graphs
- Demo - Social Media Follow Graph - Understanding Directed Graphs (10:29)
- Weighted Graphs
- Graph Traversals (BFS and DFS)
- Demo - Graph Traversals (BFS and DFS) (10:29)
- Shortest Path Algorithms (Dijkstra and Bellman-Ford)
- Demo - Package Delivery Route Optimizer (Dijkstra’s Algorithm) (8:17)
- Demo - Flight Connections - Exploring Graph Traversal (9:31)
- Minimum Spanning Trees (MSTs)
- Demo - City Network Optimization Using Prim’s Algorithm (9:34)
- Kruskal’s Algorithm
- Demo - City Network Optimization Using Kruskal’s Algorithm
- Real-World Graph Applications
- Introduction to Hashing
- Hash Functions and Keys
- Handling Collisions (Chaining and Open Addressing)
- Load Factor and Rehashing
- STL unordered_map and unordered_set
- Demo - Tracking Attendance with an Unordered Map (HashMap) (3:54)
- Performance Considerations
- Real World Hash Table Use Cases
- Hash Table Chaining
- Demo - Hash Table Chaining with Retail Products (7:26)
- Introduction to Advanced Algorithms
- Greedy Algorithms
- Greedy Scheduling Algorithms (Activity Selection Problem)
- Scheduling Algorithm Demo (6:42)
- Dynamic Programming Basics
- Dynamic Programming with the Fibonacci Sequence (4:31)
- Backtracking Algorithms
- Branch and Bound
- Heuristic Algorithms
- Traveling Salesperson Problem (TSP)
- Huffman Compression
- Combining Data Structures with Advanced Algorithms