xxxxxxxxxx
def deleteMid(head):
# Base cases
if (head == None):
return None
if (head.next == None):
del head
return None
copyHead = head
# Find the count of nodes
count = countOfNodes(head)
# Find the middle node
mid = count // 2
# Delete the middle node
while (mid > 1):
mid -= 1
head = head.next
# Delete the middle node
head.next = head.next.next
return copyHead