Student Reviews
( 5 Of 5 )
1 review
Video of Building a HashMap object in C in C Programming course by Chuck Severance channel, video No. 31 free certified online
This lecture details how to implement a hash map by minimal modifications to a list map. The hash map uses an array of eight buckets, each containing a linked list. The find method now requires a bucket index, and the get and put methods compute the bucket index from the key.
The hash map iterator traverses buckets sequentially, skipping empty linked lists. It maintains a current bucket index and a pointer to the current entry. When the current entry is null, the iterator advances to the next non-empty bucket. This design handles key distribution without rehashing.
For more materials, auto graders, and more courses, please see www.masterprogrammer.com.