My assignment was to write code to Delete an ith node on a linked list. Will this function accomplish that?
void deleteIthNode(int el){
IntSLLNode *tmp;
tmp = (IntSLLNode*)malloc(sizeof(IntSLLNode));
tmp = head;
IntSLLNode *oldTmp;
oldTmp = (IntSLLNode*)malloc(sizeof(IntSLLNode));
oldTmp = tmp;
for( int i = 1 ; i < i-1 ; i++ )
{
oldTmp = tmp;
tmp = tmp->next;
}
oldTmp->next = tmp->next;
free(tmp);
}