Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Data structure in C++ to find a string in a dictionary

Tags:

c++

I am a beginner to C++. Can some one tell me a best data structure in C++ to store all words in a dictionary and find if a word is present in the dictionary. I know hash tables are the best but I dont know which data structure uses them ?

Thank you very much in advance.

like image 432
brett Avatar asked Aug 04 '10 03:08

brett


1 Answers

Your C++ implementation's standard library may have unordered_set or hash_set. They are essentially the same thing; the former is part of the forthcoming C++0x standard and is supported by some of the latest compilers, the latter is from the original SGI STL and is included in many standard library implementations.

like image 104
James McNellis Avatar answered Oct 03 '22 05:10

James McNellis