Find Every Match in a Sorted Suffix Range
Sort full suffixes once, then find the consecutive rows starting with a query.
Adult planning suggestion: about 9–12 · Logic & rule checking
- Players
- 3 with an adult facilitator
- Time
- 15–25 minutes
- Materials
- Printed player sheet or copied paper, pencil and small counters.
Prepare
Write BANANA with positions 1–6. Make one suffix card starting at each position and continuing to the end. Do not wrap around.
Follow the rule
Sort cards lexicographically, placing a shorter string first when it is a prefix of a longer one. Keep original positions attached.
Check each step
For query ANA mark the consecutive sorted rows whose first three letters equal the query. Short suffixes that end early do not match.
Worked example
Compare with a direct scan of starting positions, allowing matches to overlap. Use A as a second query.
Finish and adapt
Finish with the original start positions for both queries, not the sorted row numbers.
Purpose, observation and provenance
Within this activity: Sort full suffixes once, then find the consecutive rows starting with a query.
Ask the checker to point to the move or calculation that decides the outcome.
Our rules, examples and printable diagrams are separately prepared. The earliest inventor of the broader mechanism is not established here.
Suffix arrays — Rule or mathematical background for our original paper exercise. The small example and end condition are ours.
Secondary practice: Cooperation and explaining a check.
For a class of 30, use ten groups of three. Prepare one player-material set per group and keep the host key with the adult. Rotate operator, recorder and checker after each worked example; a reader or scribe may help without choosing answers. Avoid public ranking or diagnostic labels.
Age bands are planning suggestions. Background references may address older learners and do not validate suitability for this age band. Goals describe observable actions, not measured long-term gains or institutional endorsement.
Free alternative: Copy the supplied grids, labels and cards onto reused paper. No specialist product is needed. Adults may prepare pieces or act as a scribe.
Printable materials
Preview at 100% scale, with browser headers and footers off. Cut with suitable help. Keep host keys separate. This is a manual tabletop kit, not an online opponent, automatic judge or solver.
Find Every Match in a Sorted Suffix Range · Player materials
Write BANANA with positions 1–6. Make one suffix card starting at each position and continuing to the end. Do not wrap around.
Sort cards lexicographically, placing a shorter string first when it is a prefix of a longer one. Keep original positions attached.
For query ANA mark the consecutive sorted rows whose first three letters equal the query. Short suffixes that end early do not match.
| Position | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| Symbol | B | A | N | A | N | A |
| Step / cell | Decision / value | Rule checked |
|---|---|---|
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
| ________ | ________ | ________ |
Find Every Match in a Sorted Suffix Range · Host key — keep separate
Sorted positions 6,4,2,1,5,3. ANA starts at 4 and 2; A at 6,4,2.
Lead and check
Write BANANA with positions 1–6. Make one suffix card starting at each position and continuing to the end. Do not wrap around.
Sort cards lexicographically, placing a shorter string first when it is a prefix of a longer one. Keep original positions attached.
For query ANA mark the consecutive sorted rows whose first three letters equal the query. Short suffixes that end early do not match.
Compare with a direct scan of starting positions, allowing matches to overlap. Use A as a second query.
Finish with the original start positions for both queries, not the sorted row numbers.
Classroom: ten trios for 30 learners; one kit per trio. Rotate operator, recorder and checker. Age guidance is a planning suggestion; prerequisite support may be necessary.