What question about every suffix-vs-prefix overlap does the Z-array answer in one pass?
What does \( Z[i] \) measure — the longest substring starting at \( i \) that matches the prefix?
Why is position zero defined specially, and what would a literal definition give?
How do the \( [l, r] \) bounds track the rightmost match segment found so far?
Why can a position inside the current Z-box copy an earlier Z-value instead of re-comparing?
What are the two cases when computing \( Z[i] \), and when must you extend by explicit comparison?
Why does the already-known Z-value at the mirrored position give a correct head start?
How does forming \( P # T \) turn Z-values into positions of every match?
Why must the separator be a character that appears in neither pattern nor text?
How do the Z-array and the \( \pi \) array encode the same self-similarity differently?
How does the Z-array help count distinct substrings, find periods, or detect repetitions?
Why is the single pass linear despite the inner extension loop?
Why does the right edge \( r \) only ever advance, bounding total comparisons at \( O(n) \)?
Why does the Z-algorithm avoid the collision-driven worst case that hashing suffers?
What memory does the algorithm consume?
Why is the Z-array \( O(n) \), and why does \( P # T \) cost \( O(n+m) \) extra for the combined string?
Where does this fit — string search libraries, compression preprocessing, bioinformatics?
Why are the separator-character choice and off-by-one box updates the usual sources of bugs?
How do the cases turn into a clean single loop?
What array and what \( l, r \) pointers do you initialize before scanning?
How does each position either copy a mirrored value or start fresh, then extend by comparison?
When and how do you move \( l \) and \( r \) after extending past the old right edge?
How do you scan the finished Z-array of \( P # T \) to emit each match position in the text?
// implement from scratch hereRecap the whole topic in a few lines — the core idea, the key complexities and trade-offs, and when to reach for it. The cheat-sheet you'd skim before an exam or interview.
Fill this in as you learn