puruagarwal1 / python_dir

accepted in hacktoberfest 2023
15 stars 111 forks source link

Adding Hashed searched base algorithm #170

Open akash110 opened 11 months ago

akash110 commented 11 months ago

i have added below code on Hashing

Hashing is a process of mapping data of arbitrary size to fixed-size values, often for efficient data retrieval. A hash function takes input and produces a "hash," a seemingly random string of characters, with the key properties of being deterministic and fast.

Code Explanation: The HashList class uses a simple hash function to map integers to indices in a list, providing a basic implementation of a hash table. The insert method adds integers to the hash table, handling collisions with chaining, and the search method checks if a given integer is present in the hash table. The example usage demonstrates the search functionality for specific integers.