DS-Algo-Point icon indicating copy to clipboard operation
DS-Algo-Point copied to clipboard

String Hashing for O(1) queries

Open itslinotlie opened this issue 4 years ago • 2 comments

🚀 Feature

The trivial way of comparing if two strings are identical is to use the built in function (.equals() in Java); however, this takes O(n) time. When many hundreds of thousands of comparisons are needed, this could result in a TLE (example ccc20s3, a Canadian computing contest problem). String hashing only requires an initial O(n) time to pre-process, but then queries are all O(1). The idea is to hash strings into numbers for constant comparison times, while avoiding collisions between the numbers.

Have you read the Contribution Guidelines?

:+1:

Pitch

The scenario described above was me during the CCC. Now knowing how to implement string hashing, I would like to contribute in both/either C++ and/or Java (:

Assigned : @itslinotlie - C++ and Java

itslinotlie avatar Oct 14 '20 11:10 itslinotlie

I am interested in doing this assignment. Please assign to me if possible.

aniketprasadgit avatar Oct 16 '20 18:10 aniketprasadgit

@aniketprasadgit , please have a look at the contributing.md once more and as I have commented on #738 on how to go about with your requests. Please understand that you have to follow the contributing guidelines. Please do comment or open an issue if you need help (I won't be repeating this) Thanks!

sunilgknair051 avatar Oct 19 '20 14:10 sunilgknair051