I'm writing an an AutoCompelete program for a competition in my local college programming group, and the person with the fastest program wins. Because of this I need a data structure that will store strings(the dictionary) and be able to access these strings very fast, will a std::vector be my best bet? Or would you guys recommend any other data structure for something like this?
The code challenge problem is as follows: You must build an autocomplete program in one of these languages: Java, C++, Ruby, Python, or PHP. The metric for winning the competition is going to be based on time to complete, so optimization is important. This means that if your program executes our input set faster than anyone else you win. Just to forewarn you though, our input set is going to be exceedingly large.
I second Trie due to the fact that it states autocomplete program. However, tries can sometimes be slow due to being a huge memory consumer. A hashtable like cire pointed is also worth implementing, you just gotta choose your hash function and internal data structure that deals with collisions :)