Software / Building Blocks
Shapes for Information
A data structure organizes information around the questions you need to answer. An array can preserve a running order; a map can look up a cue by name; a tree can group props by department; a graph can record which cue depends on another. Those are different views of the same show.
Start with the operation: finding, ordering, grouping, or connecting. Try two views of three cue cards, then ask how the choice affects the cost of an operation.
Data Structures Essentials
Watch them move
VisuAlgo animates common structures and the operations on them.
visualgoA university course, free
MIT's introduction to algorithms, built around data structures.
mit ocw: 6.006The catalog
A long list of structures, each with its trade-offs.
wiki: data structuresThe prop box and the running order
For the tiny show, each prop has a stable name and two facts used by the quiet-room check. Keep those records separate from the order in which you want to use them.
{
"cues": {
"bell": { "available": true, "sound": true },
"lantern": { "available": true, "sound": false },
"ribbon": { "available": false, "sound": false }
},
"proposedOrder": ["lantern", "ribbon"]
}
The keyed records answer “what do we know about the ribbon?” The ordered list answers “what comes after the lantern?” This is a proposed order: including the ribbon does not make the missing prop available.
- Reverse the two names in
proposedOrder. The performance changes; the facts about the props do not. - Find the ribbon and update its availability once in
cues. Both positions can refer to the same record. - Add “curtain” to the order without creating a record. Decide how a reader or program should report that missing reference.
Keep: a cue collection and a proposed order. Use Combinatorics to count the orders and Testing to check that every chosen cue is known and eligible. For larger collections, databases adds questions about storage and coordinated updates.