Algorithms on String
Here is a list of some common string algorithms:
- String searching algorithms: algorithms for finding a pattern in a string, such as
Rabin-Karp Algorithm (Rolling Hash)
, theKnuth-Morris-Pratt (KMP)
algorithm and theBoyer-Moore algorithm
. - String matching algorithms: algorithms for determining whether a string matches a given pattern, such as
regular expression
matching andfinite automata
based matching. - String manipulation algorithms: algorithms for manipulating strings, such as string concatenation, string reversal, and string
permutation
generation. - String compression algorithms: algorithms for compressing strings, such as
Huffman coding
andrun-length encoding
. - String sorting algorithms: algorithms for sorting strings, such as
radix sort
andmulti-key quicksort
. - String parsing algorithms: algorithms for extracting information from strings, such as regular expression parsing and parsing of structured data formats (e.g., CSV, JSON).
- String hashing algorithms: algorithms for computing hash values for strings, such as the SHA-2 and SHA-3 algorithms.
- String transformation algorithms: algorithms for transforming strings, such as case conversion, character encoding and decoding, and transliteration.
- String similarity algorithms: algorithms for measuring the similarity between two strings, such as the
Levenshtein distance
and theJaccard coefficient
. - String correction algorithms: algorithms for correcting errors in strings, such as spelling correction and grammar correction.
Standard Problems
- Exact Pattern Matching: Given a string
text
and stringpattern
, output all the position intext
wherepattern
appears as a substring. - Approximate Pattern Matching: Given a string
text
and stringpattern
, output all the position intext
wherepattern
appears as a substring with at mostd
mismatches. - Multiple Pattern Matching: Given a string
text
and a set of stringpatterns
, output all the position intext
where a string frompatterns
appears as a substring.