CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Hashtables

Threaded View

  1. #10
    Join Date
    Jan 2006
    Location
    Belo Horizonte, Brazil
    Posts
    405

    Re: Hashtables

    Quote Originally Posted by GCDEF
    I don't think it's based on a hash table, but an STL map serves the same purpose.
    You're right, they're not based on hash tables, but on trees. Usually, the implementations of std::map are actually red-black trees.

    Regarding the purpose of them, there're a couple of differences. As Lindley has already said, most of them come from the fact that trees provide you an ordering mechanism while hash tables don't. On the other hand, good implementations of hash tables provide you amortized constant time for accessing elements (assuming an efficient key and a balanced table).
    Last edited by ltcmelo; August 7th, 2008 at 06:25 AM. Reason: Fixed typo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured