Hello TA,
I got the position of the node, I mean the address of the node in the linked list where that particular key is lying, but how will I know that is it at head or tail and then which case to follow up to delete it.
The code I have written till now is:
void erase(string key){
int idx = hashFun(key);
Node *ptr = table[idx];
while(ptr!=NULL){
if(ptr->key==key){
break;
}
ptr = ptr->next;
}
// What is the case of deletion of Linked List
}