input: Write a function to delete a given node from a linked list. If the linked list is empty or the node is not found, the function should do nothing. The function should modify the linked list in place.
  
  # Python program to delete a node from Linked List  
    
  # Node class  
  class Node:  
    
      # Function to initialize the node object  
      def __init__(self, data):  
          self.data = data  # Assign data  
          self.next = None  # Initialize next as null  
    
    
  # Linked List class contains a Node object  
  class LinkedList:  
    
      # Function to initialize head  
      def __init__(self):  
          self.head = None
    
      # Function to delete a node  
      def deleteNode(self, node): 
    
          # Store head node  
          temp = self.head  
    
          # If head node itself holds the key to be deleted  
          if (temp is not None):  
              if (temp == node):  
                  self.head = temp.next
                  temp = None
                  return
    
          # Search for the key to be deleted, keep track of the  
          # previous node as we need to change 'prev.next'  
          while(temp is not None):  
              if temp == node:  
                  break
              prev = temp  
              temp = temp.next 
    
          # if key is not present in linked list  
          if(temp == None):  
              return
    
          # Unlink the node from linked list  
          prev.next = temp.next
    
          temp = None
  
  # Test cases
  assert LinkedList().deleteNode(Node(1)) == None  # Deleting from an empty list
  
  llist = LinkedList()
  llist.head = Node(1)
  second = Node(2)
  third = Node(3)
  llist.head.next = second
  second.next = third
  
  assert llist.deleteNode(second) == None  # Node found and deleted
  assert llist.head.next == third  # Checking if the node was deleted
  
  assert llist.deleteNode(Node(4)) == None  # Node not found
  assert llist.head.next == third  # Checking if the list remains unchanged
output: def deleteNode(self, node): 
      temp = self.head  
      if (temp is not None):  
          if (temp == node):  
              self.head = temp.next
              temp = None
              return
      while(temp is not None):  
          if temp == node:  
              break
          prev = temp  
          temp = temp.next 
      if(temp == None):  
          return
      prev.next = temp.next
      temp = None