let us call the function that adds at the front of the list is push(the push(must receive pointer to the head pointerbecause push must change the head pointer to point to the new node add node after given node ( steps processwe are given pointer to node as prev_nodeand the new node is inserted after the given node add node at the end( steps processthe new node is always added after the last node of the given linked list for example if the given dll is and we add an item at the endthen the dll becomes since linked list is typically represented by the head of itwe have to traverse the list till end and then change the next of last node to new node add node before given nodesteps let the pointer to this given node be next_node and the data of the new node to be added as new_data