function the receives a pointer to a head of a list and a pointer to a node in the list , write a function that deletes that node in O(1).
Sigiloso
void deleteNode(Node head, Node node){ if(head.next == null && node == head){ head = null; return; } // make the head point to the node // and the node point to head next Node temp = head.next; head.next = node; node.next = temp; // now take the value of the node next to node and put it insde him temp = node.next; node.data = temp.data; node.next = temp.next; }