---
title: "Discussion on \"Robin Karp Algorithm\" | Hashnode"
description: "Discussion on \"Robin Karp Algorithm\". txt -> length N        (string s)\npat -> length M       (pattern)\nN>=M\n\n//To calculate hash from previous hash\n// hash( txt[s+1 .. s+m] ) = ( d ( hash( txt[s .. s+m-1]) – txt[s]*h ) + txt[s + m] ) mod q \n\n// hash( txt[s .. s+m-1] ) : Hash value at sh..."
url: "https://hashnode.com/posts/robin-karp-algorithm/62ce461f1d29fac83b6d3a5c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Robin Karp Algorithm](https://techmadeeasy.hashnode.dev/robin-karp-algorithm?utm_source=hashnode&utm_medium=feed)

txt -> length N (string s) pat -> length M (pattern) N>=M //To calculate hash from previous hash // hash( txt\[s+1 .. s+m\] ) = ( d ( hash( txt\[s .. s+m-1\]) – txt\[s\]\*h ) + txt\[s + m\] ) mod q // hash( txt\[s .. s+m-1\] ) : Hash value at sh...

Jul 13, 2022 · 2 min read · techmadeeasy.hashnode.dev  
Read the article

-   [#cpp](https://hashnode.com/tag/cpp)
-   [#pattern-seaching](https://hashnode.com/tag/pattern-seaching)

## Written by

[Mann Jain](https://hashnode.com/@MJ16)

@MJ16 · India

  
[View profile](https://hashnode.com/@MJ16)

Engineer and Programmer

An engineer pursuing B.Tech from IIT Gandhinagar and interested in Finance, Logic, Mathematics, machine learning, artificial intelligence, computer networks, data structures and algorithms and programming.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
