POV-Ray : Newsgroups : povray.off-topic : Games programmers : Re: Games programmers Server Time
10 Oct 2024 15:17:08 EDT (-0400)
  Re: Games programmers  
From: Warp
Date: 12 Sep 2008 03:25:36
Message: <48ca1970@news.povray.org>
Mueen Nawaz <m.n### [at] ieeeorg> wrote:
>         What's a hashmap? Or rather, how does it differ from a map?

  Its usage is otherwise the same as a map, but the order of the elements
is undefined (in other words, if you traverse the hashmap from begin() to
end(), it returns the elements in an unspecified order). It will be called
std::unordered_set and std::unordered_map.

  The difference is that it will use a hash table rather than a binary tree.
In most cases it considerably reduces memory usage and can potentially be
much faster. (On the downside you have to be able to come up with a
high-quality hash function for your elements. A poorly designed function
can make the hash map very slow.)

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.