But what is wrong in build it for oursefl?, A hash table , static or dinamic is far easier that a binary treee (espacily for the delete) and easier that other estructs like avls o similars. The only thing that is import is the map function but with carefull and some tries could be perfect.vitek wrote:Last I checked, Irrlicht doesn't provide a hash map, so I didn't recommend it. The current C++ standard library doesn't provide hash containers either, so there really isn't a single portable implementation that I could refer everyone to.Why don't use a Hash for this query, if you do it properly (very easy) you have O(1) query for searching.
People do use hash maps/sets in games.By the way, you guys that have experience, why hash aren use it everywhre in video games for this kind of querys?
I don't deny that having the extra data pointer in there would be a nice thing to have. It would definitely be useful for some users. I just don't feel that it is absolutely necessary. The framework that is provided provides enough to get things working.
If, at optimization time, you actually find that there is a performance bottleneck when doing lookups, then you should optimize it. A binary search will likely be fast enough. If it isn't, then carefully constructed hash table should be plenty fast. If that isn't enough, then a user data pointer may be the only option.
Travis
Glad to hear that they are used in game dev . I just thought that I was conceptualy wrong.
By the way has anyone implemented a avl delete function easily (without lazy delete of course).
It is horrible!.