15-11-2012, 04:31 PM
HASHING TECHNIQUE
HASHING TECHNIQUE.docx (Size: 14.68 KB / Downloads: 20)
Algorithm:
Step1: Include necessary header files
Step2: Declare necessary variables
Step3: Check the value of *S
Then call Insert( )
Print “Enter the string”
Read S
Step4: Check the value of *S
Step5: Then print S by calling hGetVal( )
Step6: Call PrintHash( )
Step7: End
Algorithm For hINSERT( ):
Step1: Allocate memory to pointer
Step2: Assign index hGetIndex ( )
Step3: Assign Ptr Key Strdup(key)
Ptr Val Val
Ptr next h[index]
h[index] Ptr
Step4: Print “h[index]=key”
Step5: Return