having only single removal methodremoveis not actually restrictionsince we can remove at the beginning or end of doubly linked list by executing remove( getfirst()or remove( getlast())respectively method tostring for converting an entire list into string is useful for testing and debugging purposes circularly linked lists and linked-list sorting in this sectionwe study some applications and extensions of linked lists circularly linked lists and duckduckgoose the children' game"duckduckgoose,is played in many cultures children in minnesota play version called "duckduckgrey duck(but please don' ask us why in indianathis game is called "the mosh pot and children in the czech republic and ghana play sing-song versions known respectively as "pesekand "antoakyire variation on the singly linked listcalled the circularly linked listis used for number of applications involving circle gameslike "duckduckgoose we discuss this type of list and the circle-game application next circularly linked list has the same kind of nodes as singly linked list that iseach node in circularly linked list has next pointer and reference to an element but there is no head or tail in circularly linked list for instead of having the last node' next pointer be nullin circularly linked listit points back to the first node thusthere is no first or last node if we traverse the nodes of circularly linked list from any node by following next pointerswe will cycle through the nodes even though circularly linked list has no beginning or endwe nevertheless need some node to be marked as special nodewhich we call the cursor the cursor node allows us to have place to start from if we ever need to traverse circularly linked list and if we remember this starting pointthen we can also know when we are done-we are done with traversal of circularly linked list when we return to the node that was the cursor node when we started we can then define some simple update methods for circularly linked listadd( )insert new node immediately after the cursorif the list is emptythen becomes the cursor and its next pointer points to itself remove()remove and return the node immediately after the cursor (not the cursor itselfunless it is the only node)if the list becomes emptythe cursor is set to null