title: How to improve linked list searching. C++
body: <p>I have simple method in C++ which searchs for string in linked list. That works well but I need to make it faster. Is it possible? Maybe I need to insert items into list in alphabetical order? But I dont think it could help in serching list anymore. In list there is about 300 000 items (words).</p>
  
  <pre><code>int GetItemPosition(const char* stringToFind)
  {
      int i = 0;
      MyList* Tmp = FistListItem;
      while (Tmp){
          if (!strcmp(Tmp-&gt;Value, stringToFind))
          {
              return i;
          }
          Tmp = Tmp-&gt;NextItem;
          i++;
      }
      return -1;
  }
  </code></pre>
  
  <p>Method returns the position number if item found, otherwise returns -1.
  Any sugesstion will be helpfull.</p>
  
  <p>Thanks for answers, I can change structure. I have only one constraint. Code must implement the following interface:</p>
  
  <pre><code>int Count(void);
  int AddItem(const char* StringValue, int WordOccurrence);
  int GetItemPosition(const char* StringValue);
  char* GetString(int Index);
  int GetOccurrenceNum(int Index);
  void SetInteger(int Index, int WordOccurrence);
  </code></pre>
  
  <p>So which structure will be the in your opinion the most suitable?</p>