Skip to content

Implement ruling hash to appropriate complexity of Rabin Karp #1066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 24, 2019

Conversation

mahbubcseju
Copy link
Contributor

  • Previous solution is based on the hash function of python.
  • Implemented ruling hash to get the appropriate complexity of rabin karp.

mahbubur.rahman and others added 5 commits July 19, 2019 13:55
* Implemented the way of finding nth fibonacci.
* Complexity is about O(log(n)*8)
- Removed some extra spaces    
- Added the complexity of bruteforce algorithm  
- Removed unused function called zerro()  
- Added some docktest based on request
- Removed some extra spaces
- Added the complexity of bruteforce algorithm
- Removed unused function called zerro()
- Added some docktest based on request
- Previous solution is based on the hash function of python.
- Implemented ruling hash to get the appropriate complexity of rabin karp.
@mahbubcseju mahbubcseju reopened this Jul 24, 2019
@cclauss cclauss changed the title Updated Rabin Karp algorithm. Implement ruling hash to appropriate complexity of Rabin Karp Jul 24, 2019
@cclauss
Copy link
Member

cclauss commented Jul 24, 2019

Could you please add a test containing Unicode patterns?

- Previous solution is based on the hash function of python.
- Implemented ruling hash to get the appropriate complexity of rabin karp.
@mahbubcseju
Copy link
Contributor Author

Could you please add a test containing Unicode patterns?

Actually I dont know about Unicode pattern testing. Trying to learn about it

@cclauss
Copy link
Member

cclauss commented Jul 24, 2019

Pytest did not find our automated tests. :-(

Can you please add a docetest by changing the code to read:

def test_rabin_karp():
    """
    >>> test_rabin_karp()
    Success.
    """
    [ then the body of the function as it is and then at the end of the function... ]
    print("Success.")

@cclauss
Copy link
Member

cclauss commented Jul 24, 2019

You should be able to test this doctest locally with:
python3 -m doctest -v strings/rabin_karp.py

@mahbubcseju
Copy link
Contributor Author

You should be able to test this doctest locally with:
python3 -m doctest -v strings/rabin_karp.py

Yes , Done !

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. That works... https://travis-ci.org/TheAlgorithms/Python/builds/562971505#L670

Are we ready to merge? Or did you want to add the Unicode test(s) first?

@mahbubcseju
Copy link
Contributor Author

Yes, please merge.

@cclauss cclauss merged commit 7c3ef98 into TheAlgorithms:master Jul 24, 2019
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
…orithms#1066)

* Added matrix exponentiation approach for finding fibonacci number.

* Implemented the way of finding nth fibonacci.
* Complexity is about O(log(n)*8)

* Updated the matrix exponentiation approach of finding nth fibonacci.

- Removed some extra spaces    
- Added the complexity of bruteforce algorithm  
- Removed unused function called zerro()  
- Added some docktest based on request

* Updated the matrix exponentiation approach of finding nth fibonacci.

- Removed some extra spaces
- Added the complexity of bruteforce algorithm
- Removed unused function called zerro()
- Added some docktest based on request

* Updated Rabin Karp algorithm.

- Previous solution is based on the hash function of python.
- Implemented ruling hash to get the appropriate complexity of rabin karp.

* Updated Rabin Karp algorithm.

- Previous solution is based on the hash function of python.
- Implemented ruling hash to get the appropriate complexity of rabin karp.

*  Implemented ruling hash to appropriate complexity of Rabin Karp

Added unit pattern testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants