linked lists the insertlast(method is the same process applied to the end of the listit' mirror image of insertfirst(the insertafter(method inserts new link following the link with specified key value it' bit more complicated because four connections must be made firstthe link with the specified key value must be found this procedure is handled the same way as the find(routine in the linklist java program (listing thenassuming we're not at the end of the listtwo connections must be made between the new link and the next linkand two more between current and the new link this process is shown in figure current first last next next next next prev prev prev prev null null next prev figure insertion at an arbitrary location if the new link will be inserted at the end of the listits next field must point to nulland last must point to the new link here' the insertafter(code that deals with the linksif(current==last/if last linknewlink next null/newlink --null last newlink/newlink <-last else /not last linknewlink next current next/newlink --old next /newlink <-old next current next previous newlink