Weeks 09–12 — Data Structures & Algorithms (Stages C/D)
Storage, ordering, text, and persistence — the working data-handling
toolkit of a real programmer. ← Weeks 5–8 ·
Roadmap home · Weeks 13–16 →
Week 9 — Arrays & vectors
Session 9.1 — The C array: storage and classic passes
| Part |
Details |
| Prerequisites |
Stage B — loops and functions fluent |
| Learning objectives |
declare, initialize, and index arrays; traverse, sum, count, and find extremes; explain zero-based indexing and out-of-bounds danger; pass arrays to functions (pointer + length) |
| Concepts |
array declaration/initialization, indexing, traversal, bounds, arrays with functions, the decay convention |
| Recommended reading |
Arrays Lesson 1 — basics · Lesson 2 — classic passes |
| Examples to study |
both lessons’ passes — reproduce max, sum, and search from memory afterward |
| Exercises |
Practice Bank I-01–I-06 · arrays exercises (basics part) |
| Lab/practice |
arrays labs — first two |
| Challenge |
Practice Bank I-02 — maximum and its position |
| Estimated self-study time |
75 min |
| Completion checklist |
☐ three classic passes written from memory ☐ 2 labs done ☐ can explain why arrays need a length parameter |
Session 9.2 — vector, range-for, and the arrays miniproject
| Part |
Details |
| Prerequisites |
Session 9.1 |
| Learning objectives |
use vector for growable data; traverse with range-based for (read and write forms); choose array vs vector by the problem; build the marks analyzer |
| Concepts |
vector, push_back, size(), range-based for, int& element writes, array-vs-vector choice |
| Recommended reading |
Arrays Lesson 3 — arrays & functions (skim) · Arrays Lesson 4 — matrices (skim — full treatment in integrated problems) |
| Examples to study |
Lesson 3’s passing examples · the miniproject brief |
| Exercises |
Practice Bank I-07–I-12 · arrays predictions |
| Lab/practice |
arrays miniproject — the Marks Analyzer, milestones 1–3 |
| Challenge |
Practice Bank I-11 — matrix row/column sums |
| Estimated self-study time |
90 min |
| Completion checklist |
☐ analyzer milestones 1–3 ☐ vector version and array version of one analyzer ☐ W09 quiz ≥ 90% |
Week 10 — Searching & sorting — 🏁 Project 2
Session 10.1 — Linear and binary search
| Part |
Details |
| Prerequisites |
Week 9 — collections fluent |
| Learning objectives |
implement linear search (counting and first-match forms); implement binary search and state its sorted precondition; feel the complexity difference (linear vs logarithmic) from probe counts |
| Concepts |
linear search, binary search, loop invariants, sortedness as a precondition, complexity intuition |
| Recommended reading |
Algorithms Lesson 1 — recursion (skim — the call-stack idea returns) · Lesson 2 — searching |
| Examples to study |
Lesson 2’s probe traces — trace binary search on paper for two keys |
| Exercises |
Practice Bank A-25, A-27 · algorithms exercises (searching part) |
| Lab/practice |
algorithms labs — searching station |
| Challenge |
Practice Bank C-36 — minimum in a rotated sorted array |
| Estimated self-study time |
75 min |
| Completion checklist |
☐ binary search written from memory with the midpoint guard ☐ two paper traces ☐ can state why unsorted input breaks binary search |
Session 10.2 — The elementary sorts and Project 2
| Part |
Details |
| Prerequisites |
Session 10.1 |
| Learning objectives |
implement bubble, selection, and insertion sorts; trace each on the same data; choose a sort by data properties; build the Project 2 records manager |
| Concepts |
bubble/selection/insertion sort, pass mechanics, swap counting, stability intuition, adaptivity, records + sort keys |
| Recommended reading |
Algorithms Lesson 3 — sorting · Project 2 brief (Stage D: Student Records Manager) · Projects collection #3 as rehearsal |
| Examples to study |
Lesson 3’s three dry runs on one shared array |
| Exercises |
Practice Bank A-28–A-31 · algorithms traces |
| Lab/practice |
🏁 Project 2 — Student Records Manager (rehearsal) then the syllabus brief — milestones, test plan, rubric |
| Challenge |
Practice Bank A-31 — two-key record sort |
| Estimated self-study time |
120 min (project week) |
| Completion checklist |
☐ Project 2: milestones, tests, rubric self-scored ☐ all three sorts instrumented with counters ☐ W10 quiz ≥ 90% |
Week 11 — Strings & text processing
Session 11.1 — std::string: the working operations
| Part |
Details |
| Prerequisites |
Week 9–10 — collections fluent |
| Learning objectives |
create, read, index, concatenate, compare, and slice strings; use find, substr, and modification; process characters with <cctype> |
| Concepts |
string creation/input, indexing, + and +=, ==/< value comparison, find/substr, per-character processing, case conversion |
| Recommended reading |
Strings Lesson 1 — two ways · Lesson 2 — indexing & comparison |
| Examples to study |
both lessons’ worked examples |
| Exercises |
Practice Bank I-13–I-18 · strings exercises (first part) |
| Lab/practice |
strings labs — username validator + password checker |
| Challenge |
Practice Bank I-16 — palindrome line, letters-only |
| Estimated self-study time |
75 min |
| Completion checklist |
☐ token scanner (word-start rule) written from memory ☐ 2 labs done ☐ can contrast >> vs getline input for strings |
Session 11.2 — Text tools and the miniproject
| Part |
Details |
| Prerequisites |
Session 11.1 |
| Learning objectives |
split lines into tokens; convert between strings and numbers (stoi, to_string); avoid the common string mistakes; build the Text Analysis Toolkit |
| Concepts |
tokenization, string↔number conversion, C-strings at a glance, common mistakes gallery |
| Recommended reading |
Strings Lesson 3 — find & modify · Lesson 4 — conversions & mistakes |
| Examples to study |
Lesson 4’s mistake gallery — reproduce two, fix two |
| Exercises |
Practice Bank I-19–I-24 · strings debugging D1–D3 |
| Lab/practice |
strings miniproject — Text Analysis Toolkit, milestones 1–3 |
| Challenge |
strings challenges — two of your choice |
| Estimated self-study time |
90 min |
| Completion checklist |
☐ toolkit milestones 1–3 ☐ 3 debug hunts ☐ W11 quiz ≥ 90% |
Week 12 — File I/O
Session 12.1 — Streams: writing and reading files
| Part |
Details |
| Prerequisites |
Weeks 9–11 — data handling fluent |
| Learning objectives |
write and read text files with ofstream/ifstream; check opens; read token-grain and line-grain; choose append vs truncate deliberately |
| Concepts |
file streams, open modes, ios::app, open checks, >> vs getline on files, close discipline |
| Recommended reading |
Files Lesson 1 — streams · Lesson 2 — reading & writing |
| Examples to study |
both lessons’ worked programs — run the write-then-read cycle yourself |
| Exercises |
Practice Bank A-11–A-14 · files exercises (streams part) |
| Lab/practice |
files labs — student record file + expense tracker |
| Challenge |
Practice Bank A-14 — the append-mode log |
| Estimated self-study time |
75 min |
| Completion checklist |
☐ write→close→read cycle performed ☐ 2 labs done ☐ open-check habit demonstrated in every file program this week |
Session 12.2 — CSV records, errors, and the miniproject
| Part |
Details |
| Prerequisites |
Session 12.1 |
| Learning objectives |
parse CSV-style records (find/split/stoi); handle missing files and malformed lines; persist records and reload them; build the File-Based Student Management System |
| Concepts |
CSV parsing, record storage, file error handling, bad-line tolerance, the load→process→save cycle |
| Recommended reading |
Files Lesson 3 — errors & mistakes |
| Examples to study |
Lesson 3’s failure gallery |
| Exercises |
Practice Bank A-15–A-18 · files debugging D1–D3 |
| Lab/practice |
files miniproject — milestones 1–3 |
| Challenge |
files challenges — two of your choice |
| Estimated self-study time |
90 min |
| Completion checklist |
☐ miniproject milestones 1–3 ☐ round-trip test written (save→load→compare) ☐ Stages C/D checkpoint: W12 quiz ≥ 90% — Stage E unlocks |
Next: Weeks 13–16 — Memory, OOP, and the capstone → · Roadmap home