# Delete middle of linked list

Problem: For any given linked list, delete middle of the linked list

Problem Explanation: For any linked list,

Input: 1 -> 2 ->3 ->4 -> 5

Ouput: 1 -> 2  ->4 -> 5

Input: 9 -> 10 ->11 ->12

Ouput: 9 ->11 ->12

Java Implementation

```public class DeleteMiddleLL {
public Node deleteMiddleLL(Node node) {
if (node == null) {
return null;
}
return null;
}

Node first = node, second = node, prev = null;
prev = first;
}

if (prev != null) {
}

return node;
}

public void printLL(Node node) {
if (node == null) {
}
while (node != null) {
System.out.println(node.getValue());
}
}

public static void main(String[] args) {
Node node = new Node(1, null);

DeleteMiddleLL deleteMiddleLL = new DeleteMiddleLL();

node = deleteMiddleLL.deleteMiddleLL(node);
deleteMiddleLL.printLL(node);

}
}

public class Node {
int value;

public Node(int value, Node link) {
this.value = value;
}

public int getValue() {
return value;
}

public void setValue(int value) {
this.value = value;
}