Skip to content

Instantly share code, notes, and snippets.

@steveobbayi
Created April 2, 2016 06:45
Show Gist options
  • Save steveobbayi/9fa2ba7961df8e82dd049fd1e5a2c6e3 to your computer and use it in GitHub Desktop.
Save steveobbayi/9fa2ba7961df8e82dd049fd1e5a2c6e3 to your computer and use it in GitHub Desktop.
unordered_set<string> uset = {"three","two","three"};
unordered_set<string>::cons_iterator it = uset.find("three");
if(it != uset.end())
cout << *it << endl;
uset.insert("four");
//More on hash tables on the unordered set
cout << "The load factor is " << uset.load_factor() << endl;
cout << "Total buckets " << uset.bucket_count() << endl;
string s
cout << s << " is located in the bucket at " << uset.bucket(s) << endl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment