Metraipolis › archive › dc_42b2436c081d
Rabin–Karp algorithm — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-10-07T14:58:22.359Z
- SHA-256 of the archived text
374ce9ca982167dd20b03db48d3dfa60eee28155bceedd8751a45396d792c134- Stable URL of this page
https://metraipolis.com/documento/dc_42b2436c081d
How to cite
Rabin–Karp algorithm — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_42b2436c081d (Metraipolis archive dc_42b2436c081d, sha256 374ce9ca982167dd20b03db48d3dfa60eee28155bceedd8751a45396d792c134)
BibTeX
@misc{dc42b2436c081d,
title = {Rabin–Karp algorithm — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_42b2436c081d; sha256 374ce9ca982167dd20b03db48d3dfa60eee28155bceedd8751a45396d792c134},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
In computer science, the Rabin–Karp algorithm or Karp–Rabin algorithm is a string-searching algorithm created by Richard M. Karp and Michael O. Rabin (1987) that uses hashing to find an exact match of a pattern string in a text. It uses a rolling hash to quickly filter out positions of the text that cannot match the pattern, and then checks for a match at the remaining positions. Generalizations of the same idea can be used to find more than one match of a single pattern, or to find matches for more than one pattern. To find a single match of a single pattern, the expected time of the algorithm is linear in the combined length of the pattern and text, although its worst-case time complexity is the product of the two lengths. To find multiple matches, the expected time is linear in the input lengths, plus the combined length of all the matches, which could be greater than linear. In contrast, the Aho–Corasick algorithm can find all matches of multiple patterns in worst-case time and space linear in the input length and the number of matches (instead of the total length of the matches). A practical application of the algorithm is detecting plagiarism. Given source material, the algorithm can rapidly search through a paper for instances of sentences from the source material, ignoring details such as case and punctuation. Because of the abundance of the sought strings, single-string searching algorithms are impractical. Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»). Fonte: Wikipedia in inglese, voce «Rabin–Karp algorithm» — https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm Wikidata Q1384131 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q1384131 Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm?action=history). Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza. Estratto dell'introduzione non modificato nel contenuto; revisione 1373719006, consultata il 2026-10-07T14:31:23.813Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: f2e987dd3a997cb5c299c2aec146299da4691545fb4397f5538b8d8161014025