Skip to main content

Algorithms on String

Here is a list of some common string algorithms:

  1. String searching algorithms: algorithms for finding a pattern in a string, such as Rabin-Karp Algorithm (Rolling Hash), the Knuth-Morris-Pratt (KMP) algorithm and the Boyer-Moore algorithm.
  2. String matching algorithms: algorithms for determining whether a string matches a given pattern, such as regular expression matching and finite automata based matching.
  3. String manipulation algorithms: algorithms for manipulating strings, such as string concatenation, string reversal, and string permutation generation.
  4. String compression algorithms: algorithms for compressing strings, such as Huffman coding and run-length encoding.
  5. String sorting algorithms: algorithms for sorting strings, such as radix sort and multi-key quicksort.
  6. String parsing algorithms: algorithms for extracting information from strings, such as regular expression parsing and parsing of structured data formats (e.g., CSV, JSON).
  7. String hashing algorithms: algorithms for computing hash values for strings, such as the SHA-2 and SHA-3 algorithms.
  8. String transformation algorithms: algorithms for transforming strings, such as case conversion, character encoding and decoding, and transliteration.
  9. String similarity algorithms: algorithms for measuring the similarity between two strings, such as the Levenshtein distance and the Jaccard coefficient.
  10. String correction algorithms: algorithms for correcting errors in strings, such as spelling correction and grammar correction.

Standard Problems

  1. Exact Pattern Matching: Given a string text and string pattern, output all the position in text where pattern appears as a substring.
  2. Approximate Pattern Matching: Given a string text and string pattern, output all the position in text where pattern appears as a substring with at most d mismatches.
  3. Multiple Pattern Matching: Given a string text and a set of string patterns, output all the position in text where a string from patterns appears as a substring.