Microsoft Interview Question: Remove a node from a singly l... | Glassdoor

Interview Question

Software Development Engineer In Test (SDET) Intern Interview Redmond, WA

Remove a node from a singly linked list.

Tags:
nodes, linked lists
Answer

Interview Answer

1 Answer

0

void deleteNode(list *node){
    list *temp;
    if(node == NULL){
        return;
    }
    temp = node->next;
    memcpy(node, node->next,sizeof(list));
    free(temp);
}

Anonymous on Dec 31, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.