A doubly linked list is declared as:
class Node:
def __init__(self, value=0, prev=None, next=None):
self.value = value
self.prev = prev
self.next = nextWhich of the following segment of code deletes the node pointed to by $\text{X}$ from the doubly linked list, if it is assumed that $\text{X}$ points to neither the first nor the last node of the list?
- $\text{X}$.prev.next $= \text{X}$.next $; \text{X}$.next.prev $= \text{X}$.prev; free(X);
- $\text{X}$.prev.next $ = \text{X}$.next $; X.$ next.prev $ = \text{X}$.prev; free(X);
- $\text{X}$.prev.next $= \text{X}.$prev $; \text{X}$.next.prev $= \text{X}.$prev; free(X);
- $\text{X}$.prev.next $= \text{X}$.prev $; \text{X}$.next.prev $= \text{X}$.next; free(X);