include peek((same as front())offer( (same as enqueue( ))and poll((same as dequeue()setan interface extending collection to sets the java collections framework also includes several concrete classes implementing various combinations of the above interfaces rather than list each of these classes herehoweverwe discuss them at more appropriate places in this book one topic we would like to stress nowhoweveris that any class implementing the java util collection interface also implements the java lang iterable interfacehenceit includes an iterator(method and can be used in for-each loop in additionany class implementing the java util list interface also includes listiterator(methodas well as we observed abovesuch interfaces are useful for looping through the elements of collection or list the java util linkedlist class the java util linked list class contains lot of methodsincluding all of the methods of the deque adt (section and all of the methods from the array list adt (section in additionas we mentioned aboveit also provides functionality similar to that of the node list adt through the use of its list iterator performance of the java util linkedlist class the documentation for the java util linkedlist class makes it clear that this class is implemented with doubly linked list thusall of the update methods of the associated list iterator run in ( time each likewiseall of the methods of the deque adt also run in ( time eachsince they merely involve updating or querying the list at its ends but the methods from the array list adt are also included in the java util linkedlistwhich arein generalnot well-suited to an implementation of doubly linked list in particularsince linked list does not allow for indexed access to its elementsperforming the operation get( )to return the element at given index irequires that we perform link "hoppingfrom one of the ends of the listcounting up or downuntil we locate the node storing the element with index as slight optimizationwe observe that we can start this hopping from the closer end of the listthus achieving running time that is (min( ))