@@ -0,0 +1,637 @@
+/**%0A * Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.%0A *%0A * Supposed the linked list is 1 -%3E 2 -%3E 3 -%3E 4 and you are given the third node with value 3, the linked list should%0A * become 1 -%3E 2 -%3E 4 after calling your function.%0A *%0A * Tags: LinkedList%0A * Similar Problems: (E) Remove Linked List Elements%0A */%0Apublic class DeleteNodeInLinkedList %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A%0A    %7D%0A%0A    public void deleteNode(ListNode node) %7B%0A        if (node == null %7C%7C node.next == null) return;%0A        node.val = node.next.val;%0A        node.next = node.next.next;%0A    %7D%0A%7D%0A

add delete node in linked list