{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Hash 2 - CSC2100A Tutorial Hashing(Part 2 Spring 2006/2007...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSC2100A Spring 2006-2007 CSC2100A Tutorial Hashing (Part ) Spring 2006/2007 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 CSC2100A Spring 2006-2007 Hashing II Collision resolution – Separate Chaining (In previous tutorial…) – Open addressing • Linear probing • Quadratic probing • Random probing • Double hashing • Rehashing Extendible hashing
Background image of page 2
3 CSC2100A Spring 2006-2007 Hashing - Open addressing struct HashEntry { HashedObj element; EntryType info; /* ACTIVE = 0, EMPTY = 1, DELETED = 2 */ HashEntry( const HashedObj & e = HashedObj( ), EntryType i = EMPTY ) : element( e ), info( i ) { } }; vector<HashEntry> array; /* The hash function */ int Hash(int input, int tableSize) { return input % tableSize; }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon