listing hash tables continued /end class link ///////////////////////////////////////////////////////////////class sortedlist private link first/ref to first list item /public void sortedlist(/constructor first null/public void insert(link thelink/insert linkin order int key thelink getkey()link previous null/start at first link current first/until end of listwhilecurrent !null &key current getkey(/or current keyprevious currentcurrent current next/go to next item if(previous==null/if beginning of listfirst thelink/first --new link else /not at beginningprevious next thelink/prev --new link thelink next current/new link --current /end insert(/public void delete(int key/delete link /(assumes non-empty listlink previous null/start at first link current first/until end of listwhilecurrent !null &key !current getkey(/or key =currentprevious currentcurrent current next/go to next link /disconnect link if(previous==null/if beginning of list first first next/delete first link else /not at beginning