DS-Algo-Point
DS-Algo-Point copied to clipboard
String Hashing for O(1) queries
🚀 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
I am interested in doing this assignment. Please assign to me if possible.
@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!