for simplicityin this program we've reduced the number of data items in each link from two to one this makes it easier to display the link contents (remember that in serious program there would be many more data itemsor reference to another object containing many data items this program inserts three items at the front of the listinserts three more at the endand displays the resulting list it then deletes the first two items and displays the list again here' the outputlist (first-->last) list (first-->last) notice how repeated insertions at the front of the list reverse the order of the itemswhile repeated insertions at the end preserve the order the double-ended list class is called the firstlastlist as discussedit has two data itemsfirst and lastwhich point to the first item and the last item in the list if there is only one item in the listboth first and last point to itand if there are no itemsthey are both null the class has new methodinsertlast()that inserts new item at the end of the list this process involves modifying last next to point to the new link and then changing last to point to the new linkas shown in figure first next next next next null last abefore insertion first next next next next last first bafter insertion null figure insertion at the end of list