Module M06 · 6 of 35 in teaching order · Beginner

Strings

Encodings, code units and code points, immutability, and building strings efficiently.

Lessons

  1. What a string really stores: UTF-8 bytes, UTF-16 units and surrogate pairs, code points, grapheme clusters, and why length differs between languages.

  2. Count characters with an array or a hash map, test anagrams in O(n), check palindromes with two pointers, and know when the alphabet size changes the answer.

  3. Find every occurrence of a pattern in a text: the O(n·m) naive search, the prefix function built step by step, and the KMP scan that never moves backwards.

Topics this module covers

The full module scope. Topics without a lesson above are not written yet.

  • representation
  • encoding
  • Unicode
  • mutability
  • indexing
  • concatenation
  • builders
  • slicing
  • comparison
  • frequency
  • palindrome
  • anagram

Builds toward