chap listsstacksand queues public void movetostart(curr /reset position public void movetoend(curr listsize/reset public void prev(if (curr ! curr--/back up public void next(if (curr listsizecurr++/next /return list size public int length(return listsize/return current position public int currpos(return curr/set current list position to "pospublic void movetopos(int posassert (pos>= &(pos<=listsize"pos out of range"curr pospublic getvalue(/return current element assert (curr>= )&&(curr<listsize"no current element"return listarray[curr]figure (continuedelements in the array must shift toward the head by one position to fill in the gap to remove the element at position in elements must shift toward the head in the average caseinsertion or removal requires moving half of the elementswhich is th(nmost of the other member functions for class alist simply access the current list element or move the current position such operations all require th( time aside from insert and removethe only other operations that might require more than constant time are the constructorthe destructorand clear these three member functions each make use of the system free-store operation new as discussed further in section system free-store operations can be expensive linked lists the second traditional approach to implementing lists makes use of pointers and is usually called linked list the linked list uses dynamic memory allocationthat isit allocates memory for new list elements as needed linked list is made up of series of objectscalled the nodes of the list because list node is distinct object (as opposed to simply cell in an array)it is good practice to make separate list node class an additional benefit to creating