I would like to create a functionality DISTINCT keyword of mysql in c++ using hashmap or unordered_map.
I have to do this in parallel e.g. initially I have input integers in an array.
Now I have to find distinct number in array (in parallel)
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 the original array doesn’t change and assuming the available
g++extension forhash_map:Since the underlying data doesn’t change the
distinct_elemswon’t change either, hence the code:or if you simply want to look up the value within the hashmap:
You can do this from any number of threads with no locking since data is now basically constant.