-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f20710
commit e8db9d8
Showing
6 changed files
with
666 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CC=g++ | ||
Output:main.o hash.o | ||
$(CC) main.o hash.o -o nameht | ||
main.o:main.cpp | ||
$(CC) -c main.cpp | ||
hash.o:hash.cpp | ||
$(CC) -c hash.cpp | ||
clean: | ||
rm *.o nameht |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
Implement Hash ADT with closed Hashing. | ||
|
||
Consider the dataset given for previous laboratory session on BSTs. Further consider the field, | ||
Name N as a key. Assume that all keys at least 5 characters long and may discard keys/records | ||
which are shorter than 5 characters. Implement Hash table ADT with the necessary member | ||
functions, | ||
• to initialize the hash table (HT) with a specific size and specific collision resolving technique | ||
• to insert a record with the given key | ||
• to delete a record with the given key | ||
• to find a record with the given key | ||
• to rehash the hash table when load factor λ > 0.75 | ||
• to print the statistics of number of probes for unsuccessful U and successful S find operations | ||
carried out so far and current load factor λ | ||
format of execution: | ||
./nameht option [SIZE] [KEY] [CR] | ||
option: | ||
1. to initialize hash table for specific SIZE and CR | ||
2. to find a given KEY | ||
3. to insert a given KEY | ||
4. to delete a given KEY | ||
5. to compute load factor | ||
6. to rehash hash table to a given size SIZE | ||
7. to display statistics | ||
Arguments mentioned in [ ] brackets are optional. | ||
Example: | ||
./nameht 1 500 LP - to create a hash table with size 500 slots and linear probing resolving | ||
technique | ||
./nameht 2 “vijay kumar” - find the name “vijay kumar” in the hash table. If exists, print its | ||
frequency | ||
./nameht 4 arun - delete the record with Key “arun” | ||
|
Binary file added
BIN
+8.06 MB
cpp/data_structures/Hash_implementation/dataset_random_2000k.txt.tar.gz
Binary file not shown.
Oops, something went wrong.