Module 5 · list and forward_list: When Elements Move and Positions Must Not
Full Programs: From a To-do List to an LRU Cache
Free with an accountReading
Amara kept her to-do list in a vector. Each new task that belonged after another one went in with insert, and every task behind it shifted one place. Each finished task left with erase, and the tasks behind it shifted back. This lesson starts from the same to-do list in a list, where nothing shifts. Six programs follow, each a little bigger; read the "new thing" line above each one first.
Checking what this lesson needs for you…
What is inside Full Programs: From a To-do List to an LRU Cache
- Program 1: Amara's to-do list
- Program 2: Maria's playlist
- Program 3: a one-line editor with Home and End
- Program 4: a quiz round in a circle
- Program 5: exam marks, merged and spliced
- Program 6: an LRU cacheIntermediate