listing continued /public boolean isempty(/true if no links return first==null/public void insertfirst(long dd/insert at front of list link newlink new link(dd)/make new link ifisempty(/if empty listlast newlink/newlink <-last else first previous newlink/newlink <-old first newlink next first/newlink --old first first newlink/first --newlink /public void insertlast(long 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