ฝึกคณิตศาสตร์ไม่ต่อเนื่อง

Z Function

เรียกดูบทเรียน Z Function ภายใน Algorithmic Thinking and Complexity

1 บทเรียน · 5 คำถาม

Algorithmic Thinking and Complexity

Big-O, loop analysis, graph algorithms, invariants, and developer-focused discrete math.

1 บทเรียน · 410 คำถาม

Z Function

1 บทเรียน · 5 คำถาม

Least You Need to Know: Z-Function, Prefix Matches, and Pattern Search by Concatenation
The Z-function at position i stores the length of the longest substring starting at i that matches the whole string prefix. This lets you reason about repeated prefix structure and perform pattern search via concatenation.
เปิดบทเรียน