Prep
Thursday, 30 July 2020
Separate Chaining - Coursera Algorithms
To deal with
collisions
in hashing,
separate chaining
implementation can be used, where M linked lists(<number of elements N) are used such that :
1. Hash - map key to i between 0 and M-1.
2. Insert - at the front of ith chain.
3. Search - in ith chain.
Easier to implement and clustering less sensitive to poorly designed hash function.
Following is the implementation:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment