mardi 8 octobre 2019

How unordered_map

I can assign negative elements as key in map, like map[-1]=10; how it handles it in back, what data structure is used for it? I know unordered_map uses hashing internally, how it handles negative elements for hashing? If I use an array for hashing I can't hash negative elements cause array index can't be negative

Aucun commentaire:

Enregistrer un commentaire