/demonstrates doubly-linked list /to run this programc>java doublylinkedapp ///////////////////////////////////////////////////////////////class link public double ddata/data item public link next/next link in list public link previous/previous link in list /public link(double /constructor ddata /public void displaylink(/display this link system out print(ddata ")//end class link ///////////////////////////////////////////////////////////////class doublylinkedlist private link firstprivate link last/ref to first item /ref to last item /public doublylinkedlist(/constructor first null/no items on list yet last null/public boolean isempty(/true if no links return first==null/public void insertfirst(double 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