/first --newlink /public void insertlast(double dd/insert at end of list link newlink new link(dd)/make new link ifisempty(/if empty listfirst newlink/first --newlink else last next newlink/old last --newlink newlink previous last/old last <-newlink last newlink/newlink <-last /public link deletefirst(/delete first link /(assumes non-empty listlink temp firstif(first next =null/if only one item last null/null <-last else first next previous null/null <-old next first first next/first --old next return temp/public link deletelast(/delete last link /(assumes non-empty listlink temp lastif(first next =null/if only one item first null/first --null else last previous next null/old previous --null last last previous/old previous <-last return temp//insert dd just after key public boolean insertafter(double keydouble dd/(assumes non-empty listlink current first/start at beginning while(current ddata !key/until match is found