key is :(x,y) , that means 2 integers.
value is: 0 or 1.
And I have frequently operation of iteration of this hash map.
Which data structure is fit? I am using C++ stl or tr1. Don’t consider boost.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, the data format stored obviously is a bool.
And for the key format, if you would know the bitsize of those integers and performance is a must, I would use a associative array (called a
mapin C++) with twice the bitwidth integers as key:But this would work fine too and is semantically much better: