Below is a small figure that shows a linked list with 4 nodes. Please show the necessary steps to insert a node after the 2nd element in the list.
head tail end
5 8 2 7
next --->next ---->next ---->next--------end
end--prev<--- prev<---- prev <---- prev
You may use auxiliary variables of type nodePtr (a pointer to a node structure), if you need.