Skip to main content
gamedev.net
🔒 Locked

bidirectional hash table

Started by chollida1 2 replies 1k views
Original Post
chollida1
chollida1
I'm looking for a data structure that is akin to a bidirectional hash table. I've got an SVG DOM structure on one side and my internal rendering structures on the other and I"d like to map between them. I'd like to be able to say given a DOM node, find my internal rendering struct. or given an internal rendering struct get me the corresponding DOM node. If I only wanted to go one way I'd use a hash table, but I need to be able to look up from either direction. Any one have any experince with such a structure?? Cheers Chris
CheersChris
iMalc
iMalc
Just use two hash tables. One where you has the "DOM node" and one where you hash the "internal rendering struct".
Or could you just store pointers to each other in both?
chollida1
chollida1
Quote:
Original post by iMalc
Just use two hash tables. One where you has the "DOM node" and one where you hash the "internal rendering struct".
Or could you just store pointers to each other in both?


Thanks iMalc, I thought about that but didnt' want to influence any one by saying that:). I was hopeing for a more elegant solution than having parallel structures that need to be kept in sync:)

Anonymous poster, you nailed it! Thanks very much!

Cheers
Chris
CheersChris

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.