Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Hash Map

Reply
Thread Tools

Hash Map

 
 
Salman
Guest
Posts: n/a
 
      04-17-2007
How can I use Haspmap in C++ and what will be benefit of hashmap over
arrays?

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      04-18-2007
Salman wrote:
> How can I use Haspmap in C++ and what will be benefit of hashmap over
> arrays?


A hash map is what's known as an associative container. It has some
specific properties that allow quick insertion and retrieval of any
element. In arrays elements are indexed, in hash maps elements are
"hashed".

If you can find an implementation of a hash map, use it. Usually
you include the header and define your container, just like you would
a 'vector' or 'list'.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      04-18-2007
On Apr 18, 2:27 am, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:
> Salman wrote:
> > How can I use Haspmap in C++ and what will be benefit of hashmap over
> > arrays?


> A hash map is what's known as an associative container. It has some
> specific properties that allow quick insertion and retrieval of any
> element. In arrays elements are indexed, in hash maps elements are
> "hashed".


> If you can find an implementation of a hash map, use it. Usually
> you include the header and define your container, just like you would
> a 'vector' or 'list'.


You normally also have to provide a hashing function. This is
non-trivial, and if you don't understand the basic principles of
a hash map (as the original poster obviously doesn't), then the
probability of your writing an effective hashing function is
close to zero.

--
James Kanze (GABI Software) email:
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hash of hash of hash of hash in c++ rp C++ 1 11-10-2011 04:45 PM
Hash#select returns an array but Hash#reject returns a hash... Srijayanth Sridhar Ruby 19 07-02-2008 12:49 PM
how to put the content of one hash map to another hash map navS C++ 3 05-09-2008 12:52 PM
STL map or hash map using struct as data and find it kl C++ 7 01-01-2008 11:05 AM
Hash Map slower than Map. Amit Bhatia C++ 7 10-09-2007 09:33 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57