Category : hash

I am a beginner to hash function. I tried to implement the substring equality problem using hashes. Problem Description Input Format. The first line contains a string 𝑠 consisting of small Latin letters. The second line contains the number of queries 𝑞. Each of the next 𝑞 lines specifies a query by three integers 𝑎, ..

Read more

I’m trying to help a friend who uses a self-control program on his Windows machine to limit distractions. The program is locked with a password. I’m his accountability partner. I used to email him the password every time he needed it, but he has admitted to me, he wouldn’t delete the email and use the ..

Read more

Down in the void prontHashTable(), getting error in the line for (auto x : hashTable[i]). what mistake have I made? originally did that for only an array consisting of integers. But now that I am trying to make a sort of database, getting an E0349 error. #include<iostream> #include<list> #include<string> using namespace std; class Student { ..

Read more

I know how to compare two strings with "==" or "compare", but if the string is very long, should we use a hash function and then compare with hash code ? static int n = 100000; bool TestCompare(const string& a, const string& b) { return a == b; } bool TestCompareHash(const string& a, const string& ..

Read more