I want to read an array of integers, hash each integer and put it into an hash table and later lookup the table to search for the value. What would be the efficient way to do that in c/c++? Thanks in advance
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your compiler supports it, you can use
std::unordered_set. If your compiler doesn’t support that yet, most implementations supporthash_set(which is well documented in the SGI STL documentation).