Add characters of S$ one at a time. Watch the global end extend leaves, the active point move, Rule 2 splits create internal nodes, and suffix links (dashed purple) appear.
| phase (char index i) | - |
| adding character | - |
| global end (leafEnd) | -1 |
| remaining | 0 |
| active_node | root |
| active_edge | - |
| active_length | 0 |
| rule applied | start |
| nodes / leaves | 1 / 0 |
global end (leaf edges share one end index, extended for free each phase),
suffix links (dashed purple, O(1) hops between node "xα" and "α"), and the
active point (active_node, active_edge, active_length) with skip/count. See middle.md and professional.md.