You are given a pointer/ reference to the node which is to be deleted from the linked list of N nodes. The task is to delete the node. Pointer/ reference to head node is not given. 
Note: No head reference is given to you. It is guaranteed that the node to be deleted is not a tail node in the linked list.
Example 1:
Input:
N = 2
value[] = {1,2}
node = 1
Output: 2
Explanation: After deleting 1 from the
linked list, we have remaining nodes
as 2.
Example 2:
Input:
N = 4
value[] = {10,20,4,30}
node = 20
Output: 10 4 30
Explanation: After deleting 20 from
the linked list, we have remaining
nodes as 10, 4 and 30.
Your Task:
You only need to complete the function deleteNode that takes reference to the node that needs to be deleted. The printing is done automatically by the driver code.
Expected Time Complexity : O(1)
Expected Auxilliary Space : O(1)
Constraints:
2 <= N <= 10^{3}

Source: geeksforgeeks | Difficulty: EASY
Tags: Data structures

Starter code: #User function Template for python3

'''

    Your task is to delete the given node from

	the linked list, without using head pointer.

	

	Function Arguments: node (given node to be deleted) 

	Return Type: None, just delete the given node from the linked list.



	{

		# Node Class

		class Node:

		    def __init__(self, data):   # data -> value stored in node

		        self.data = data

		        self.next = None

	}

'''

class Solution:

    #Function to delete a node without any reference to head pointer.

    def deleteNode(self,curr_node):

        #code here

Solutions:
class Solution:

	def deleteNode(self, curr_node):
		curr_node.data = curr_node.next.data
		curr_node.next = curr_node.next.next


class Solution:

	def deleteNode(self, curr_node):
		node = curr_node
		cur = node.next
		node.data = cur.data
		node.next = cur.next


class Solution:

	def deleteNode(self, curr_node):
		if curr_node is None or curr_node.next is None:
			return
		next_node = curr_node.next
		curr_node.data = next_node.data
		curr_node.next = next_node.next


class Solution:

	def deleteNode(self, curr_node):
		prev = None
		temp = curr_node
		while temp.next != None:
			temp.data = temp.next.data
			prev = temp
			temp = temp.next
		prev.next = None


class Solution:

	def deleteNode(self, cur):
		if cur.next == None:
			return
		dele = cur.next
		cur.data = dele.data
		cur.next = dele.next


class Solution:

	def deleteNode(self, curr_node):
		curr_node.data = curr_node.next.data
		next_node = curr_node.next
		curr_node.next = next_node.next
		next_node.next = None


class Solution:

	def deleteNode(self, curr_node):
		if not curr_node or not curr_node.next:
			curr_node = None
			return
		curr_node.data = curr_node.next.data
		temp = curr_node.next
		curr_node.next = temp.next
		temp.next = None
		return


class Solution:

	def deleteNode(self, curr_node):
		if curr_node is None:
			return
		elif curr_node.next is None:
			return
		curr_node.data = curr_node.next.data
		curr_node.next = curr_node.next.next


class Solution:

	def deleteNode(self, curr_node):
		temp = curr_node
		temp1 = curr_node
		temp2 = curr_node
		l = []
		i = 0
		while temp:
			l.append(temp.data)
			temp = temp.next
			i += 1
		for i in range(1, i):
			temp1.data = l[i]
			temp1 = temp1.next
		for i in range(i - 1):
			temp2 = temp2.next
		temp2.next = None


class Solution:

	def deleteNode(self, curr_node):
		prev = curr_node
		curr = curr_node.next
		nxt = curr_node.next.next
		prev.data = curr.data
		prev.next = nxt
		return


class Solution:

	def deleteNode(self, node):
		temp = node.next
		node.data = temp.data
		node.next = temp.next
		del temp


class Solution:

	def deleteNode(self, curr_node):
		prev_node = curr_node
		curr_node = curr_node.next
		prev_node.data = curr_node.data
		prev_node.next = curr_node.next
		curr_node.next = None


class Solution:

	def deleteNode(self, curr_node):
		pos = curr_node
		if pos is None:
			return
		elif pos.next is None:
			print("This is last node, require head, can't be freed\n")
			return
		pos.data = pos.next.data
		pos.next = pos.next.next
		return


class Solution:

	def deleteNode(self, curr_node):
		if curr_node is None:
			return
		if curr_node.next is None:
			curr_node = None
			del curr_node.data
			return
		tmp = curr_node.next
		curr_node.data = curr_node.next.data
		curr_node.next = curr_node.next.next
		del tmp


class Solution:

	def deleteNode(self, temp):
		if temp.next:
			temp.data = temp.next.data
			temp.next = temp.next.next


class Solution:

	def deleteNode(self, temp):
		if temp.next is None:
			temp = None
		else:
			temp.data = temp.next.data
			temp.next = temp.next.next


class Solution:

	def deleteNode(self, curr_node):
		if curr_node.next != None:
			curr_node.data = curr_node.next.data
			ptr = curr_node.next.next
			curr_node.next = ptr


class Solution:

	def deleteNode(self, curr_node):
		prev = curr_node
		curr = curr_node.next
		nex = curr_node.next.next
		prev.data = curr.data
		prev.next = curr.next
		del curr


class Solution:

	def deleteNode(self, curr_node):
		ptr = curr = curr_node.next
		curr_node.data = ptr.data
		curr_node.next = ptr.next


class Solution:

	def deleteNode(self, curr_node):
		while curr_node.next.next:
			curr_node.data = curr_node.next.data
			curr_node = curr_node.next
		curr_node.data = curr_node.next.data
		curr_node.next = None


class Solution:

	def deleteNode(self, curr_node):
		if curr_node is None:
			return
		if curr_node.next is None:
			return 'not possible to delete'
		curr_node.data = curr_node.next.data
		curr_node.next = curr_node.next.next


class Solution:

	def deleteNode(self, curr_node):
		if not curr_node or not curr_node.next:
			return
		curr_node.data = curr_node.next.data
		next_node = curr_node.next
		curr_node.next = next_node.next
		next_node.next = None
		del next_node


class Solution:

	def deleteNode(self, curr_node):
		temp = curr_node
		temp.data = curr_node.next.data
		temp.next = curr_node.next.next
		return temp


class Solution:

	def deleteNode(self, curr_node):
		temp = curr_node.next
		curr_node.data = temp.data
		curr_node.next = temp.next
		del temp


class Solution:

	def deleteNode(self, curr):
		curr.data = curr.next.data
		curr.next = curr.next.next


class Solution:

	def deleteNode(self, curr_node):
		temp = curr_node.next
		curr_node.data = temp.data
		curr_node.next = temp.next
		temp.next = None


class Solution:

	def deleteNode(self, curr_node):
		curr_node.data = curr_node.next.data
		curr_node.next = curr_node.next.next
		return None


class Solution:

	def deleteNode(self, curr_node):
		head = curr_node
		head.data = head.next.data
		k = head.next
		head.next = head.next.next
		k.next = None


class Solution:

	def deleteNode(self, node):
		if node is None or node.next is None:
			return
		node.data = node.next.data
		node.next = node.next.next


class Solution:

	def deleteNode(self, curr_node):
		if curr_node.next.next is None:
			curr_node.data = curr_node.next.data
			curr_node.next = None
		else:
			n = curr_node
			while n.next.next is not None:
				n.data = n.next.data
				n = n.next
			n.data = n.next.data
			n.next = None


class Solution:

	def deleteNode(self, curr_node):
		while curr_node:
			curr_node.data = curr_node.next.data
			curr_node.next = curr_node.next.next
			break


class Solution:

	def deleteNode(self, curr_node):
		next_node = curr_node.next
		next_next_node = curr_node.next.next
		curr_node.data = next_node.data
		curr_node.next = next_next_node


class Solution:

	def deleteNode(self, curr):
		if not curr.next:
			return
		temp = curr.next
		curr.data = temp.data
		curr.next = curr.next.next


class Node:

	def __init__(self, data):
		self.data = data
		self.next = None

class Solution:

	def deleteNode(self, curr_node):
		curr_node.data = curr_node.next.data
		curr_node.next = curr_node.next.next