Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 63 for Karp (0.15 sec)

  1. strings/rabin_karp.py

        # Test 3)
        pattern = "AAAB"
        text = "ABAAAAAB"
        assert rabin_karp(pattern, text)
    
        # Test 4)
        pattern = "abcdabcy"
        text = "abcxabcdabxabcdabcdabcy"
        assert rabin_karp(pattern, text)
    
        # Test 5)
        pattern = "Lü"
        text = "Lüsai"
        assert rabin_karp(pattern, text)
        pattern = "Lue"
        assert not rabin_karp(pattern, text)
        print("Success.")
    
    
    Python
    - Registered: 2020-06-25 19:18
    - Last Modified: 2020-06-16 08:09
    - 2.5K bytes
    - Viewed (0)
  2. Rabin-Karp/rabin-karp.swift

    }
    
    extension Character {
        var asInt: Int {
            let s = String(self).unicodeScalars
            return Int(s[s.startIndex].value)
        }
    }
    
    // Find first position of pattern in the text using Rabin Karp algorithm
    public func search(text: String, pattern: String) -> Int {
        // convert to array of ints
        let patternArray = pattern.characters.flatMap { $0.asInt }
        let textArray = text.characters.flatMap { $0.asInt }
    
    Plain Text
    - Registered: 2020-06-21 14:26
    - Last Modified: 2016-10-20 15:56
    - 3.7K bytes
    - Viewed (0)
  3. experimental/utilities/python/rabin_karp_hash.py

    ## Rabin-Karp Rolling Hash
    ## Implementation of: https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm#Hash_function_used
    ##
    ## This rolling hash function is useful when you need to compute the hash of successive substrings
    ## of text. E.g. note that going from 'abcd' to 'bcde', we drop the 'a' from the back and add an 'e'
    ## on the right. The rolling hash function thus allows us to update the hash in-place O(1) instead of
    Python
    - Registered: 2020-07-12 04:05
    - Last Modified: 2019-07-15 01:52
    - 1.9K bytes
    - Viewed (0)
  4. src/algorithms/string/rabin-karp/README.md

    # Rabin Karp Algorithm
    
    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 any one of a set 
    of pattern strings in a text. 
    
    ## Algorithm
    
    The Rabin–Karp algorithm seeks to speed up the testing of equality of 
    the pattern to the substrings in the text by using a hash function. A 
    Plain Text
    - Registered: 2020-06-23 14:50
    - Last Modified: 2018-08-09 02:57
    - 2.5K bytes
    - Viewed (0)
  5. Rabin-Karp/README.markdown

    # Rabin-Karp string search algorithm
    
    The Rabin-Karp string search algorithm is used to search text for a pattern.
    
    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.
    
    ## Example
    
    Plain Text
    - Registered: 2020-06-21 14:26
    - Last Modified: 2017-11-26 07:27
    - 2.9K bytes
    - Viewed (0)
  6. Rabin-Karp/Rabin-Karp.playground/Contents.swift

    //: Taking our rabin-karp algorithm for a walk
    
    // last checked with Xcode 9.4
    #if swift(>=4.0)
    print("Hello, Swift 4!")
    #endif
    
    import UIKit
    
    struct Constants {
        static let hashMultiplier = 69061
    }
    
    precedencegroup PowerPrecedence { higherThan: MultiplicationPrecedence }
    infix operator ** : PowerPrecedence
    func ** (radix: Int, power: Int) -> Int {
        return Int(pow(Double(radix), Double(power)))
    }
    Plain Text
    - Registered: 2020-06-21 14:26
    - Last Modified: 2019-01-09 05:09
    - 2.7K bytes
    - Viewed (0)
  7. src/algorithms/cryptography/polynomial-hash/README.md

    family of such hash functions treats the symbols of a string as coefficients of 
    a *polynomial* with an integer variable `p` and computes its value modulo an 
    integer constant `M`:
    
    The *Rabin–Karp string search algorithm* is often explained using a very simple
    rolling hash function that only uses multiplications and 
    additions - **polynomial rolling hash**:
    
    Plain Text
    - Registered: 2020-06-23 14:50
    - Last Modified: 2018-08-09 12:12
    - 4.7K bytes
    - Viewed (0)
  8. contents/algorithms/topics.md

    ---
    id: topics
    title: Topics
    ---
    
    ## Arrays
    
    ## Strings
    
    - Prefix trees (Tries)
    - Suffix trees
    - Suffix arrays
    - KMP
    - Rabin-Karp
    - Boyer-Moore
    
    ## Sorting
    
    - Bubble sort
    - Insertion sort
    - Merge sort
    - Quick sort
    - Selection sort
    - Bucket sort
    - Radix sort
    - Counting sort
    
    ## Linked Lists
    
    ## Stacks
    
    ## Queues
    
    ## Hash tables
    
    - Collision resolution algorithms
    Plain Text
    - Registered: 2020-07-12 04:05
    - Last Modified: 2019-07-15 01:52
    - 1.5K bytes
    - Viewed (0)
  9. Others/RabinKarp.java

    /**
     * @author Prateek Kumar Oraon (https://github.com/prateekKrOraon)
     */
    import java.util.Scanner;
    import java.lang.Math;
    
    //An implementation of Rabin-Karp string matching algorithm
    //Program will simply end if there is no match
    public class RabinKarp {
    
        public static Scanner scanner = null;
        public final static int d = 256;
    
        public static void main(String[] args){
    
            scanner = new Scanner(System.in);
    Java
    - Registered: 2020-06-21 12:23
    - Last Modified: 2020-05-21 22:28
    - 2.6K bytes
    - Viewed (0)
  10. README.zh-CN.md

      * `A` [Knuth–Morris–Pratt 算法](src/algorithms/string/knuth-morris-pratt) KMP 算法 - 子串搜索 (模式匹配)
      * `A` [字符串快速查找](src/algorithms/string/rabin-karp) - 子串搜索 (模式匹配)
      * `A` [Rabin Karp 算法](src/algorithms/string/rabin-karp) - 子串搜索
      * `A` [最长公共子串](src/algorithms/string/longest-common-substring)
      * `A` [正则表达式匹配](src/algorithms/string/regular-expression-matching)
    * **搜索**
    Plain Text
    - Registered: 2020-06-23 14:50
    - Last Modified: 2018-12-28 14:35
    - 17.8K bytes
    - Viewed (0)
Back to top