#include#include int main() { std::unordered_set mySet = {3, 1, 5, 2, 7}; for(auto i : mySet) std::cout << i << " "; return 0; }
#includeThis code creates a HashSet of integers containing the numbers 3, 1, 5, 2, and 7. Then it checks if the number 5 is present in the set using the find() function. If it is present, it outputs a message saying so. If not, it outputs a message saying that it is not present. Overall, the HashSet data structure is implemented in C++ using the std::unordered_set class from the#include int main() { std::unordered_set mySet = {3, 1, 5, 2, 7}; int n = 5; if(mySet.find(n) != mySet.end()) std::cout << n << " is present in the set"; else std::cout << n << " is not present in the set"; return 0; }