Overview
Bitap packs pattern-prefix state into machine words, making exact or approximate matching fast for short patterns.
Searches for patterns by updating bit masks that represent matching prefixes.
Compact metadata for implementation and discovery.
Bitap packs pattern-prefix state into machine words, making exact or approximate matching fast for short patterns.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(pattern length / word size)
state = ((state << 1) | 1) & mask[char]Updates bit masks that track active pattern prefixes.
Show matched positions, dynamic-programming cells, or candidate buckets.
Bitap Algorithm should be used with the assumptions and tradeoffs of bit-Parallel String Search in mind.
What each reference supports for this entry.
Pattern-matching reference covering Bitap Algorithm approximate matching model, string similarity measure, or bit-parallel search strategy.
Specific reference for bit-parallel shift-or text searching and bitmask-based pattern matching.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Bitap uses bit-parallel state updates rather than prefix-function transitions.
Bitap can support approximate or regular-expression-like matching variants.