#>shapes_for_information
arrays maps trees

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

Data Structures Essentials

Watch them move

VisuAlgo animates common structures and the operations on them.

visualgo

A university course, free

MIT's introduction to algorithms, built around data structures.

mit ocw: 6.006

The 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.

  1. Reverse the two names in proposedOrder. The performance changes; the facts about the props do not.
  2. Find the ribbon and update its availability once in cues. Both positions can refer to the same record.
  3. 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.