Hashing and Hash Tables
Hashing and Hash Tables
Create a HashTable
Hash Function
Add New Record To Hash Table
Find a record in the hash table
Deleting a record
FUNCTION Hash(Key:INTEGER)
DECLARE hashval : INTEGER
hashVal ß Key MOD 15
RETURN hashVal
END FUNCTION
TYPE STUDENT
DECLARE Student Id : INTEGER
DECLARE Student Gpa : REAL
END TYPE
FOR x ß 0 TO 14
Class[x].Id ß -1
Class[x].Gpaß0.0
NEXT
END FOR
ELSE
OUTPUT “The Gpa of student is”, Class[Index].Gpa
END IF
ELSE
OUTPUT “There are not elements in the array”
END IF
END PROCEDURE