//Let n = size of the hash table // hashTable = array of size n, which represents the hash table // hashIndex = represents the index of array // If the list is EMPTY, we add the element into the list /*If the list is NOT EMPTY then we compare the newNode to the node already in the list in such a way to get sorted.*/ struct node { int key; T value; struct node *next; }; struct node *hashTable[n] = {NULL}; struct node * createNode(int key, char *name, int age) { struct node *newnode; newnode = (struct node *)malloc(sizeof(struct node)); newnode->key = key; newnode->value = value; newnode->next = NULL; return newnode; } add(int key, T value) { int hashIndex = key % n; struct node *newNode = creteNode(key,value); /*Adding new node to the list with No element */ if (hashTable[hashIndex] == NULL) { hashTable[hashIndex] = newnode; return; } /*Adding new node to the sorted list */ struct node *temp1; struct node *temp2 = hashTable[hashIndex]; temp1 = temp2; while(temp2 -> key < newNode -> key) { temp1 = temp2; temp2 = temp2 ->next; } newnode->next = temp2; temp1->next = newNode; return; } Solution //Let n = size of the hash table // hashTable = array of size n, which represents the hash table // hashIndex = represents the index of array // If the list is EMPTY, we add the element into the list /*If the list is NOT EMPTY then we compare the newNode to the node already in the list in such a way to get sorted.*/ struct node { int key; T value; struct node *next; }; struct node *hashTable[n] = {NULL}; struct node * createNode(int key, char *name, int age) { struct node *newnode; newnode = (struct node *)malloc(sizeof(struct node)); newnode->key = key; newnode->value = value; newnode->next = NULL; return newnode; } add(int key, T value) { int hashIndex = key % n; struct node *newNode = creteNode(key,value); /*Adding new node to the list with No element */ if (hashTable[hashIndex] == NULL) { hashTable[hashIndex] = newnode; return; } /*Adding new node to the sorted list */ struct node *temp1; struct node *temp2 = hashTable[hashIndex]; temp1 = temp2; while(temp2 -> key < newNode -> key) { temp1 = temp2; temp2 = temp2 ->next; } newnode->next = temp2; temp1->next = newNode; return; }.