Thread: Hash Tables

  1. #1
    Registered User
    Join Date
    Jun 2008
    Houston, Texas

    Hash Tables

    Hey everyone.

    I'm a new programmer, just started C++ about a month ago and I've been using Matlab for about three years now. My job this summer requires me to learn some C++ for some string analysis work.

    Part of the method involves building a huge library of short strings. With my Matlab background, I wrote an algorithm that simply collects them all in a large vector array and then searches through them one line at a time. Easy, done, give me my A and let me move on.

    But there's a problem. I need to do this is C++, which is not nearly as good as Matlab is for matrix manipulations. The idea of using a hash table came up. Now, my boss knows his stuff pretty well, so I'm inclined to believe that he knows what he's talking about.

    Now, I've done my prerequisite background googling on hash tables and read a few pages. However, I usually find that forums are the best place for information like this. If anyone has any sites that are good, I'd appreciate them. Also, any little tips or tricks, suggestions as to what libraries or commands I should be looking into would be appreciated as well.

    Thanks a lot guys.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    If your compiler has a TR1 implementation, you can use std::tr1::unordered_set and std::tr1::unordered_map. If not, you should be able to get an implementation from Boost.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jun 2008
    Houston, Texas
    Sounds good, I'll look into that.

    Thanks for your time

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Iterable hash tables
    By OnionKnight in forum Tech Board
    Replies: 5
    Last Post: 07-21-2008, 02:02 AM
  2. developing hash tables in the C Programming language
    By w108dab in forum C Programming
    Replies: 1
    Last Post: 05-20-2008, 11:20 AM
  3. need help with hash tables with direct chaining
    By agentsmith in forum C Programming
    Replies: 4
    Last Post: 01-05-2008, 04:19 AM
  4. Group Project Help/Volunteer
    By DarkDot in forum C++ Programming
    Replies: 3
    Last Post: 04-24-2007, 11:36 PM
  5. Problems with Hash Tables
    By Zildjian in forum C Programming
    Replies: 6
    Last Post: 11-06-2003, 08:53 PM