human
Linked List | Set 2 ( Inserting a node ) | This function is in LinkedList class . Inserts a new node after the given prev_node . This method is defined inside LinkedList class shown above.
1. check if the given prev_node exists.
2. Create new node & 3. Put in the data.
4. Make next of new Node as next of prev_node.
5. make next of prev_node as new_node"
How can the above be solved in Python?
 Can you provide a code to linked List and the other steps required?
assistant
#Here is code to linked List and the other steps required.
 def insertAfter ( self , prev_node , new_data ) :
	if prev_node is None :
		print " The ▁ given ▁ previous ▁ node ▁ must ▁ inLinkedList . "
		return
	new_node = Node ( new_data )
	new_node . next = prev_node . next
	prev_node . next = new_node