1

I want to know whether C++ has any inbuilt library to implement hash tables. Basically I want to use it to remove duplicates from a linked list. And for this I want to use inbuilt C++ hash table. I would be really great if anyone help me with it.

Thanks in advance.

Shubham
  • 57
  • 2
  • C++ does *not* have any such thing (as opposed to some other languages), but its standard library does. – Ami Tavory May 18 '15 at 12:45
  • See [this answer](http://stackoverflow.com/questions/4885676/remove-duplicates-from-a-listint) for an implementation using `remove_if` and `unordered_set`. – Tony Delroy May 19 '15 at 01:18

1 Answers1

4

Following hash table data structures are available with standard template library:

std::unordered_set 
std::unordered_multiset 
std::unordered_map

and std::unordered_mutimap are using hash table

In your specific case, I think std::unordered_set may be enough.

Galik
  • 47,303
  • 4
  • 80
  • 117
Steephen
  • 14,645
  • 7
  • 40
  • 47