Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

avivdon/my-hash-table-struct

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-hash-table-struct

Demonstration of a custom hash table data structure

This project is given as an assignment of a course in The Open University. The assignment was to implement a hash based data structure that is capable of storing strings as fast as possible, while trying to avoid inaccuracy (while speed is at max priority over accuracy). Hence, given 3 parameters (N = amount of items stored, m = size of bitarray, K = amount of different hash functions), there is a certain possibility that a given string that was not inserted into the structure will actually be found as inserted.

The project allows you to examine the effect of those 3 parameters (N, m, K) on the possibility that the search function will fail and announce a string as "inserted".

Hashing

I used Universal hashing in order to generate K random hashing functions.

String-to-key

I converted each string to an integer key as a 128 base number using ascii code of each character (e.g: given the string "hi", using ascii code "h"=104, "i"=105, the key will be 104 x 128^0 + 105 x 128^1=13544)

Examples using different parameters

You can find the used text files in the repository.

About

Demonstration of a custom hash table data structure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.