The so called "four Russians technique" is often used to speed up algorithms by packing several data items in a single memory cell. Given a sequence of n symbols over a constant size alphabet, one can pack the sequence into O (n/λ) memory cells in O (log λ) time using n/log λ processors, where λ is the number of symbols packed into one memory word. Given a pattern of length m and a text of length n, this paper presents an efficient CRCW-PRAM string-matching algorithm for packed strings that takes O (log log (m/λ)) time and performs O (n/λ) operations for λ = O (log n), an improvement by a factor of λ on the number of operations used in previous algorithms. Using this string-matching algorithm one can test if a string is square-free and find all palindromes in a string in O (log log n) time using n/log log n processors.
ASJC Scopus subject areas
- Computer Science Applications