error occurs if is the first position next( )return the position of the element of following the one at position pan error occurs if is the last position the above methods allow us to refer to relative positions in liststarting at the beginning or endand to move incrementally up or down the list these positions can intuitively be thought of as nodes in the listbut note that there are no specific references to node objects moreoverif we provide position as an argument to list methodthen that position must represent valid position in that list node list update methods in addition to the above methods and the generic methods size and isemptywe also include the following update methods for the node list adtwhich take position objects as parameters and/or provide position objects as return values set(pe)replace the element at position with ereturning the element formerly at position addfirst( )insert new element into as the first element addlast( )insert new element into as the last element addbefore(pe)insert new element into before position addafter(pe)insert new element into after position remove( )remove and return the element at position in sinvalidating this position in