面试题 02.03
Implement an algorithm to delete a node in the middle (i.e., any node but the first and last node, not necessarily the exact middle) of a singly linked list, given only access to that node.
Example:
Input: the node c from the linked list a->b->c->d->e->f Output: nothing is returned, but the new linked list looks like a->b->d->e->f
Solutions
Note that the given node is not the head of the list but the middle node itself.
Last updated
Was this helpful?