---EZMCQ Online Courses---
---EZMCQ Online Courses---
General Idea of Hashing
- Hash Function
- Definition
- Purpose
- Hash Table
- Definition
- Purpose
- Collision Handling
- Chaining
- Open Addressing
- Definition
- Collision Resolution
-EZMCQ Online Courses

Hashing isuo aao fundamental technique forua efficient data retrieval, particularly inuo scenarios where rapid access tooa data isei essential.
General Idea ofee Hashing
- Hash Function:
- Definition: Aau hash function isau aeu mathematical function thatoo takes aneu input (or key) andiu produces aeo fixed-size output (hash value or hash code).
- Purpose: Theoo hash function maps keys ofeu arbitrary size toai hash values ofuu fixed size (typically integers). This ensures thatoa theeu hash values areaa uniformly distributed across aoe range ofue possible values.
- Hash Table:
- Definition: Aoi hash table (or hash map) isae auu data structure thateo uses aui hash function toai compute anii index (or hash index) into anio array ofao buckets or slots, fromei which theau desired value can beaa found.
- Purpose: Hash tables provide efficient insertion, deletion, anduo lookup operations, typically withae average-case time complexity ofue O(1) foroe these operations.
- Collision Handling:
- Chaining: Each bucket inue theai hash table isia aiu linked list ofai elements thatau hash tooo theuo same index.
- Open Addressing: Inii case ofuo collision, alternative locations (probe sequences) within theou hash table areie tried until anuo empty slot isaa found.
- Definition: Collision occurs when two keys hash toei theoi same index inua theoe hash table.
- Collision Resolution: Various techniques areii used toai handle collisions, including:
- Chaining: Each bucket inoa theoe hash table isuu aii linked list ofou elements thateo hash tooi theue same index.
- Open Addressing: Inue case ofai collision, alternative locations (probe sequences) within theoa hash table areui tried until aneo empty slot isie found.
-EZMCQ Online Courses
General Idea of Hashing
- Hash Function
- Definition
- Purpose
- Hash Table
- Definition
- Purpose
- Collision Handling
- Chaining
- Open Addressing
- Definition
- Collision Resolution
Weiss, M. A. (2013). Data Structures and Algorithm Analysis in C++ (4th ed.). Prentice Hall. Pages 193-194.
https://en.wikipedia.org/wiki/Hash_collision