String
An array of characters, so most string algorithms are array algorithms with characters in the cells.
Decision · step 2 of 6String Matching: Naive, every shift
Shift 0: pattern under "abcabc". 5 agree, then 'c' differs from 'd'. Move on to shift 1.
What you will see
Characters in cells with indices; immutability shown as copy-on-change.
Cost
| access | O(1) |
|---|---|
| search | O(n) |
| concatenate | O(n + m) |
| Space | O(n) |
How you work with it here
play it through, step one change at a time, scrub to any step, run it on your own input, try operations in any order.
Screen readers: Each element is an accessibility element with position, value and state; structural changes are announced per step.
Reduced motion: Elements appear at their destination with a crossfade; no travel longer than the element's own size.
Before this
Related
Leads to
Topics that need this one first.
Taught by the same lesson
String Matching covers these too, in the same run.