CS 211: Midterm : 100 points
Instructor: Prof. Santosh Nagarakatte
Full Name Here:
RUID:
Question
Max Points
Points
1
20
2
20
3
20
4
20
5
20
1

Problem 1: C Programming (20 points)1. You are implementing a hash table with open chaining where each node is of the following type.struct node{int id;// represents hash keyint data;// data of an itemstruct node * link;};Given that the hash table is implemented as an array of pointers to hash table nodes, implement thefollowing hashsearch function to search a key in the hash table. If the key is found, the search functionreturns the value associated with the key and returns -1 otherwise. The value MAXENTRIES is thenumber of buckets in the hash table.Your code should carefully handle all corner cases, shouldcompile, and should not experience segmentation faults on any input.Use (key + 797) modulo MAXENTRIES as the hash function.struct node * hash_table[MAX_ENTRIES];int hash_search(int key){
2

